This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Pipeline BWA aln+samse

Hi I'm trying to pipeline the bwa aln and samse commands.

This works:

bwa samse reference.fa <(bwa aln reference.fa test.fq) test.fq > test.sam

But this doesn't:

bwa aln reference.fa test.fq | bwa samse reference.fa test.fq > test.sam

Why is that, what is the difference? Thank you.

bwa

1 answer

Wrong order of arguments or rather the sai argument missing:

$ bwa samse
Usage: bwa samse [-n max_occ] [-f out.sam] [-r RG_line] <prefix> <in.sai> <in.fq>

bwa aln reference.fa test.fq | bwa samse reference.fa - test.fq > test.sam

By the way, doesn't work is no error message.

Ah ok, I had no idea you could use the dash that way. Now it makes sense. Thank you!

You can also use /dev/stdin instead in this case but most tools where Heng Li had his hands on, e.g. bwa, samtools, seqtk interpret - as read from stdin.

Log in to answer this question.