GithubHelp home page GithubHelp logo

r_command_line's Introduction

r_command_line

scripts for command line use

批量替换代码中的字符

使用方法:

./qgsub.R -h
Usage: ./qgsub.R [options]


Options:
        -t TEMPLATE, --template=TEMPLATE
                File need to be changed

        -m MAPPING, --mapping=MAPPING
                Mapping file, each column corresponds to the values to replace

        -r REPLACE, --replace=REPLACE
                Character that need to be replaced, if there are more than 1 word, words should been splited by space

        -p PREFIX, --prefix=PREFIX
                Prefix of output files

        -s SUFFIX, --suffix=SUFFIX
                Suffix of output files

        -d DIR, --dir=DIR
                output dir

        -h, --help
                Show this help message and exit

比如,现在有一个需要替换的PBS文件test_com.pbs(需要将<file1><file2>替换成多个文件名),要替换的文件放在-t参数后面:

#PBS -N run_NeoPredPipe
#PBS -l nodes=1:ppn=2
#PBS -l walltime=480:00:00
#PBS -S /bin/bash
#PBS -q pub_fast
#PBS -j oe

NeoPredPipe.py -I <file1> -H hla_typing.txt -O <file2>

将需要替换的字符放在-r参数后面,多个字符用空格分割;将用来替代的内容放在-m参数后,每列代表相应的替换内容(比如第一列表示-r中要替换的第一个字符所要替代的内容,以此类推,列之间以空格分割);输出文件的前缀用-p表示,后缀用-s表示;输出文件路径放在-d后:

##map文件
f1 o1
f2 o2
f3 o3
qgsub.R -t test_com.pbs  -m map -r "<file1> <file2>" -p test_ -s pbs -d out/

ls out
#test_f1.pbs  test_f2.pbs  test_f3.pbs

r_command_line's People

Contributors

wt12318 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.