bash - how to use gnu parallel over a range of numbers given by command-line arguments -


i'm trying use gnu parallel basic bioinformatic tools, e.g. lastz. have 10 seqs, , want use lastz on of them, use:

parallel --dryrun lastz 'pathtofile/seq{}.fa query.fasta --format=text > lastz_results_seq{}' ::: {1..10}  

which works fine , returns:

lastz pathtofile/seq1.fa query.fasta --format=text > lastz_results_seq1 lastz pathtofile/seq2.fa query.fasta --format=text > lastz_results_seq2 lastz pathtofile/seq3.fa query.fasta --format=text > lastz_results_seq3 ... lastz pathtofile/seq10.fa query.fasta --format=text > lastz_results_seq10 

but ideally i'd step part of bash script takes 3 command-line arguments, number of seqs (eg. 1 10) given in command-line (with $2 = startvalue, $3 = endvalue). thought changing work:

parallel --dryrun lastz 'pathtofile/seq{}.fa query.fasta --format=text > lastz_results_seq{}' ::: {"$2".."$3"} 

but instead, returns

lastz pathtofile//seq\{\1..\10\} query.fasta --format=text > lastz_results_seq\{\1..\10\} 

can please tell me i'm doing wrong here? looks interpreting $2 1, , $3 10, fails treat range of numbers...

this not asking, might better solution:

parallel --dryrun lastz {} query.fasta --format=text '>' lastz_results_{/.} ::: pathtofile/seq*.fa 

if argument list long try:

printf '%s\n' pathtofile/seq*.fa | parallel --dryrun lastz {} query.fasta --format=text '>' lastz_results_{/.}  

this way not need know in advance how many seq*.fa there are.


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -