fastq processing with parallel command
1
0
Entering edit mode
3.3 years ago

Hello, I'm trying to use the parallel command to use GATK tools faster. However, I cannot set the F1 and F2 parameters in the FastqToSam tool. How can I do that? The method I'm trying is this:

ls ~/fastqfolder/*R1* | parallel --bar -j 8 "gatk FastqToSam -F1 {} -F2 {} -O {}.sam

I can export the F1 file with this command, but I couldn't figure out how to export the F2 file. Can you help me?

parallel fastq gatk • 1.0k views
ADD COMMENT
1
Entering edit mode
3.3 years ago
ATpoint 81k

Imagine your files are like Basename_R1.fastq.gz and Basename_R2.fastq.gz you can first list all R1 files, extract the basename and then feed this into parallel:

ls *_R1.fastq.gz \
| awk -F "_R1.fastq.gz" '{print $1}' \
| parallel "gatk FastqToSam -F1 {}_R1.fastq.gz -F2 {}_R2.fastq.gz -O {}.sam"

Guess who asked the same question when he was new to the field :) https://stackoverflow.com/questions/45843483/basename-in-gnu-parallel

ADD COMMENT
0
Entering edit mode

it's amazing working. thank you very much :)

ADD REPLY

Login before adding your answer.

Traffic: 2643 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6