This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Piping BWA MEM to Picard SortSam

Hi, I am working with limited amount of disk space so I want to know if it possible to pipe BWA MEM to Picard SortSam? If so, what would be the proper command for it? I want to skip the SAM file and directly sort and convert it to BAM.

I do aware I can pipe BWA MEM to Samtools Sort but I plan to stick with GATK best practices as much as possible.

alignment

Hello mirza14.10!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

1 answer

I am working with limited amount of disk space

there is no 'magic' Picard SortSam uses an external sorting algorithm and will buffer the reads on your disk https://en.wikipedia.org/wiki/External_sorting

I want to know if it possible to pipe BWA MEM to Picard SortSam?

you can try (not tested...)

bwa (...) | java -jar picard.jar SortSam I=/dev/stdin ...

Samtools Sort but I plan to stick with GATK best practices as much as possible.

any pointer/url where they say "you should use picard for sorting your bam files " ?

Log in to answer this question.