Entering edit mode
7.1 years ago
dw845316
▴
20
Hello Friends,
I have have 30 paired forward and reverse fastq files that I need to run BBtools repair.sh on. As of now I can only run one pair at a time. Is there a way to run repair.sh on each pair without me having to do it individually?
bash repair.sh 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
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:
(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)
I have file names in the following format: HB-7R-25L0.clean.R1.fastq.gz, HB-7R-25L0.clean.R2.fastq.gz I tried to use parallel, as you suggested but dynamic replacement is not happening.
This echos the entire filename and does not capture the sample name HB-7R-25L0.clean, hence it does not pass to the next step as desired. Instead it replaces with
in1=HB-7R-25L0.clean.R1.fastq.gz.R1.fastq.gz, in2=HB-7R-25L0.clean.R2.fastq.gz.R2.fastq.gz
It would help
you have an issue with the command:
parallel --plus echo {%R..fastq.gz} ::: *.fastq.gz
(extra dot before R is necessary)I would suggest digit instead of dot after R as following:
is this what you are trying to do?
Thanks. The issue is not resolved. Opening a new post now with more details.
Hi @cpad0112. Please take a look at the question here Dynamic string replacement issue in parallel for repair.sh bbmap
Yeah ! :-). Now it is clear, where the mistake is. I have been trying to feed the first echo{} values and it feeds the entire output.