wrangling-genomics
wrangling-genomics copied to clipboard
Variant Calling Workflow: example has incorrect samtool sort options and param
We taught the variant calling lesson here at Notre Dame on 3/4/20.
At one point in the lesson, this use of samtools sort is given:
Sort BAM file by coordinates
Next we sort the BAM file using the sort command from samtools. -o tells the command where to write the output.
$ samtools sort -o results/bam/SRR2584866.aligned.sorted.bam results/bam/SRR2584866.aligned.bam
We are using samtools version 1.9 here, and with version there are several problems with the example:
- The -o option will send the output to standard out
- The source and destination parameters are swapped.
- A destination file name is given, rather than a file prefix- this results in a results file ending in bam.bam
The usage syntax that worked fro us was:
samtools sort results/bam/SRR2584866.aligned.bam results/bam/SRR2584866.aligned.sorted
`
Hi @msuhovec ! Thank you for your comment and for raising this issue. I remember testing the exact commands with no issues, so I am a bit perplexed as to why this happened.
Looking through the samtools manual here it says the following:
The sorted output is written to standard output by default, or to the specified file (out.bam) when -o is used.
Additionally, swapping source and destination should not matter, given that the -o
is specified.
Also, I just tried the command (locally, and not on the Amazon image) and it seems to work fine. However, it is a distinct possibility that this was an issue in the image directly.
During the workshop, did you use a local installation, or the Carpentries-provided Amazon instance?