swiftbiosciences / primerclip

Swift Accel-Amplicon primer trimming tool for fast alignment-based primer trimming
Other
10 stars 6 forks source link

Update README to use bash FIFO to directly support BAMs (rather than making SAM files) #6

Open niemasd opened 3 years ago

niemasd commented 3 years ago

One recommendation for the README: rather than recommending users to use samtools view -h to produce a SAM file on disk, it may be better to recommend users to use a bash FIFO via <() to directly support BAMs, e.g. the following:

primerclip PRIMERS <(samtools view -h INPUT_BAM) >(samtools view -S -b > OUTPUT_BAM)

Also, in my case, my BAMs were coordinate-sorted, rather than name-sorted as primerclip requires, which can be easily handled as well:

primerclip PRIMERS <(samtools sort -n -O sam INPUT_BAM) >(samtools view -S -b > OUTPUT_BAM)

or alternatively:

primerclip PRIMERS <(samtools sort -n INPUT_BAM | samtools view -h) >(samtools view -S -b > OUTPUT_BAM)