On 22 Apr 2020, at 17:10, Pedro Hollanda Carvalho 
<hollandacarva...@gmail.com<mailto:hollandacarva...@gmail.com>> wrote:
I'm unable to perform samtools sort command. Result is a weird buch of symbols 
followed by letters and numbers as follows (just a part of it):
yOR�����G(��< {`�m�wF�D/�q|lOS�}�H

This weird bunch of symbols is your BAM file being printed to your terminal. 
The reason for this happening with samtools sort is that you are using a very 
outdated version of samtools that misunderstands the samtools options in the 
instructions you're following. This is also confirmed by the "SAM header is 
present" message from samtools view, which hasn't existed since before samtools 
1.0 in 2014.

You should install (or get your systems people to assist in installing) an 
up-to-date samtools, currently version 1.10. Once you've done that, the command 
lines you're using will work as expected.

Also, the result of SAM is weird as it does not seem to fit the usual file 
format:

$ head Kp02.sam
@HD VN:1.0 SO:unsorted
@SQ SN:OMLG01000001.1 LN:1427
@SQ SN:OMLG01000002.1 LN:12368
[snip]

This is as expected for the headers in a SAM file. You'd have to head a few 
more lines to see the alignment records after all the headers. (It is a bit 
unusual to see VN:1.0 -- even the earliest deployed SAM files have VN:1.3 or so 
-- but it doesn't much matter and in this case is something that has been 
output by bowtie2.)

The command used to perform samtools sort was
samtools sort -O bam -o Kp03_sorted.bam

When you've got the up-to-date samtools installed, you'll find that its sort 
command can read from SAM files too. So your samtools view -bS + samtools sort 
can be simplified to read the bowtie output SAM file directly:

samtools sort -Obam -o Kp03_sorted.bam Kp03.sam

    John
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to