Question: How to use BBtools on multiple files
gravatar for dw845316
2.3 years ago by
dw84531620 wrote:

Hello Friends,

I have have 30 paired forward and reverse fastq files that I need to run BBtools on. As of now I can only run one pair at a time. Is there a way to run on each pair without me having to do it individually?

bash in1=DW2_S12_L001_R1_001.fastq_16S.fastq in2=DW2_S12_L001_R2_001.fastq_16S.fastq out1=fixed1.fastq out2=fixed2.fastq outs=singleone.fastq repair

Cheers, Danny

ADD COMMENTlink written 2.3 years ago by dw84531620

No issues with your way of execution. Since repair on one set of files (R1 and R2 of one sample) are independent of another set (R1 and R2 of another sample), this work can be parallelized. Try parallel in linux:

$  parallel --plus echo {%R._001.fastq_16S.fastq}  ::: *.fastq  | parallel ' in1={}R1_001.fastq_16S.fastq in2={}R2_001.fastq_16S.fastq out1={}fixed_R1_001.fastq_16S.fastq out2={}fixed_R2_001.fastq_16S.fastq outs={}single.fastq repair'

(assuming that all your files have (R1 and R2) have same extensions: R1_001.fastq_16S.fastq and R2_001.fastq_16S.fastq after sample names and parallel version is GNU parallel 20171022)

ADD REPLYlink modified 2.3 years ago • written 2.3 years ago by cpad011212k
gravatar for genomax
2.3 years ago by
United States
genomax78k wrote:

Use a for loop. Something like this should work:

for i in `ls -1 *R1*.fastq | sed 's/_R1_001.fastq_16S.fastq//'`; do in1=$i\_R1_001.fastq_16S.fastq in2=$i\_R2_001.fastq_16S.fastq out1=$i\_fixed_R1_001.fastq_16S.fastq out2=$i\_fixed_R2_001.fastq_16S.fastq outs=$i\_single.fastq repair; done
ADD COMMENTlink modified 2.3 years ago • written 2.3 years ago by genomax78k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 773 users visited in the last hour