Question: Samtools sort error
gravatar for V
3.9 years ago by
V230 wrote:


I've got a SAM file that was aligned using HISAT2, I've converted it into a BAM file using samtools view, I then wanted to sort it using samtools sort and this output comes out and just keeps going and going so I stop it.

G{�q�[�p�Π�������3FqB��m6�p�0���ꜘ-â��&�S��]��qn�Շ��67^�Q<GK?��=c<�>d�9�.�!�.���� 0�_�f*:�h?��'�4��닱�؍7Kp•�}�
�Dtc+q�ʔ)�}���zX��g�=;ήT�D��9��B�)�|��J��   N<e���֐٘3����e>��D�R"@�E9bꁞJ���H��r�0F`���n�{�aW��(���AIu�����\xq�o��A������\{�;�u9�W%����/ٍ%��o8
                k^{{�h���L�IS���?���v�ե0����H���f��hأ)<kI���~   �˟���4hQ�"�j*�tN�fltT��)�>�J��PVՄ������cbT�ډ�5��b�2xg�!���).����cS����c7���jS�pq

The ultimate goal is that I want to convert my sam file into a bam file and then index it to help with viewing. Would anyone know of a way around this or how to fix this?

samtools rnaseq • 1.8k views
ADD COMMENTlink modified 3.9 years ago • written 3.9 years ago by V230

I almost feel sorry for the Biostars syntax highlighter :(

Write this stuff out to a file with "> sorted.bam"

ADD REPLYlink written 3.9 years ago by John12k

I am pleased that the site did not blow up to pieces when a BAM file is posted - though the RSS feed did.

As for the answer, what you have there is a binary, BAM file that is being output to your screen. Redirect it or use the manual to see how to save that into a file rather than a screen.

ADD REPLYlink modified 3.9 years ago • written 3.9 years ago by Istvan Albert ♦♦ 85k

samtools has very convenient help information on the command line. Just type samtools or samtools sort to get usage information. In addition, which version are you using?

ADD REPLYlink written 3.9 years ago by WouterDeCoster44k

Yes yes lets all troll the ubuntu newbie :) Thanks! Got it to work.

ADD REPLYlink written 3.9 years ago by V230

We promise not to .. only if use ADD REPLY/ADD COMMENT when responding to existing posts next time :) This helps keep threads logically organized.

ADD REPLYlink written 3.9 years ago by genomax91k

Sorry...growing pains!

ADD REPLYlink written 3.9 years ago by V230
gravatar for John Marshall
3.9 years ago by
John Marshall2.1k
Glasgow, Scotland
John Marshall2.1k wrote:

Try rereading the samtools sort documentation (see man samtools, or here for the current version) and checking that you are giving the sort options and arguments correctly.

ADD COMMENTlink written 3.9 years ago by John Marshall2.1k
gravatar for Johanna Schott
3.9 years ago by
Johanna Schott390 wrote:

Don't worry! This is how a bam file should look like:) It is a binary version of the "human readable" sam file. If I look at the first few lines of one of my own bam files with "head mysample.bam", what I see looks very similar to your output. If you want to see the "human readable" format again, use samtools: "samtools view mysample.bam | head" should show you the first lines of your bam file as you had it in the original sam file. As John suggested, write the output to a file and not to the screen.

ADD COMMENTlink written 3.9 years ago by Johanna Schott390
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1109 users visited in the last hour