Friday, August 02, 2013

compatible command line for different input format (*.fastq, *.fq, or *.fq.gz)

For example, if I want to run bowtie with fastq or zipped fastq files, here is the workout:

(([[ $i =~ "fq|fastq$" ]] && cat $i) || ([[ $i =~ "gz$" ]] && zcat $i)) | bowtie genome -v 1 -M 1 --best --strata -q - -S accepted_hits.sam 2> mapping.summary

In above example, bowtie will take input in format of *.fastq, *.fq, or *.gz and output the best hit (or one of the best hits if multiple hits map equally best) for each read with 1 mismatch allowed, and redirect the log to mapping.summary file.

No comments:

Post a Comment