This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Weird output when trying to convert sam to bam!

Hi,

I have mapped my reads using STAR. Then I am trying to convert the output SAM file to BAM using code below but I get a strange respond. Could somebody tell what I am doing wrong? Thanks in advance.

samtools view -Sb Aligned.out.sam aligned.bam
[samopen] SAM header is present: 6 sequences.
??�?BC?}?͑�N�@?��jL�S��ca�
[main_samview] random alignment retrieval only works for indexed BAM files.
��Zc<y2��|�ͷ;3��9=y�0�M8{d���q3���6?I�?�H!鈳?C?DvF�S��hX��<�?�ۚԚJT��?��e��y��+�i�."?��܀U�fI4�
                                                                                            ^?[����*�D����bQ�Pe�8��jR�i?��6�?Z��VTD?!I#���*�R_&CKru˴?
�?I���`]��?�1E���9���i>�?��<��m                     ѧI���!D��+$?%1?f�?B�x�0.�Ӳzd�p���g�e�2؏=t�
                               �Y����^�:�5�l�0�6?��N���[�    ��F��???�?BC???%
sam samtools bam

1 answer

You need to specify the output '-o (out.bam)' argument

samtools view -Sb -o aligned.bam Aligned.out.sam

Oops, sure I need to. Thanks a lot!

Log in to answer this question.