This is a test version of Biostars. For the public version, visit https://www.biostars.org.
TRUNCATED FILE CREATION when samtools is used to produce both_ends_unmapped.bam from sample.bam

After converting sam file into bam file I was using the below command to get unmapped file

 samtools view -b -f 12 sample_mapped_and_unmapped.bam > sample_bothEndsUnmapped.bam

This command is not showing error but its getting stopped within seconds by creating a very small size file which on doing head sample_bothEndsUnmapped.bam saying that error in line 1, truncated file. I am showing here the head and tail od my sam an bam files ,so that the error can be resolved. head bam:below

[W::sam_hdr_parse] duplicated sequence 'BDDB'
[W::sam_hdr_parse] duplicated sequence 'BDB'
[W::sam_hdr_parse] duplicated sequence ':'
[W::sam_hdr_parse] duplicated sequence 'B'
[W::sam_hdr_parse] duplicated sequence '4'
[W::sam_hdr_parse] duplicated sequence '<'
[W::sam_hdr_parse] duplicated sequence '<'
[W::sam_hdr_parse] duplicated sequence 'B'
[W::sam_hdr_parse] duplicated sequence ':'
[W::sam_hdr_parse] duplicated sequence 'C'
[W::sam_hdr_parse] duplicated sequence '4'
[W::sam_hdr_parse] duplicated sequence 'A@'
[W::sam_hdr_parse] duplicated sequence ':'
[W::sam_hdr_parse] duplicated sequence '<'
[W::sam_hdr_parse] duplicated sequence '@'
[W::sam_hdr_parse] duplicated sequence 'CC'
[W::sam_hdr_parse] duplicated sequence 'A'
[W::sam_hdr_parse] duplicated sequence 'B'
[W::sam_hdr_parse] duplicated sequence 'A'
[W::sam_hdr_parse] duplicated sequence 'A'
[W::sam_hdr_parse] duplicated sequence 'C'
[W::sam_hdr_parse] duplicated sequence 'C>'
[W::sam_hdr_parse] duplicated sequence '5'
[W::sam_hdr_parse] duplicated sequence 'B'
[W::sam_hdr_parse] duplicated sequence 'C'
[W::sam_hdr_parse] duplicated sequence 'C'
[W::sam_hdr_parse] duplicated sequence '5'
[W::sam_hdr_parse] duplicated sequence 'BB'
[W::sam_hdr_parse] duplicated sequence 'C>'
[W::sam_hdr_parse] duplicated sequence '5'
[W::sam_hdr_parse] duplicated sequence 'ACC'
[W::sam_hdr_parse] duplicated sequence 'C'
[W::sam_hdr_parse] duplicated sequence 'A@'
�BC�_��ْ互-�����m�QYYE    � F�Y&�Lj����"�Jf�M?r�G����}N�r50�a��r�5���/�����s����_��g�/���-������������������_��_�u��ß�g������02N�q�
 ���ܳ�L���ϴ���8��d����$�q�'v�8���Ħ��Fõ��穽6�k��_�7�;����Y��y�<��������'��
                                                                           ='t�͛�.~�ԏs�^L�G��y��$~t���)�_>z����wS�/76�wwC?ү{�������x������ѝ7�{c�

head sam: below

@HD VN:1.0  SO:unsorted
@SQ SN:NC_000001.11 LN:248956422
@SQ SN:NT_187361.1  LN:175055
@SQ SN:NT_187362.1  LN:32032
@SQ SN:NT_187363.1  LN:127682
@SQ SN:NT_187364.1  LN:66860
@SQ SN:NT_187365.1  LN:40176
@SQ SN:NT_187366.1  LN:42210
@SQ SN:NT_187367.1  LN:176043
@SQ SN:NT_187368.1  LN:40745
@SQ SN:NT_187369.1  LN:41717
@SQ SN:NC_000002.12 LN:242193529
@SQ SN:NT_187370.1  LN:161471
@SQ SN:NT_187371.1  LN:153799
@SQ SN:NC_000003.12 LN:198295559
@SQ SN:NT_167215.1  LN:155397
@SQ SN:NC_000004.12 LN:190214555
@SQ SN:NT_113793.3  LN:209709
@SQ SN:NC_000005.10 LN:181538259
@SQ SN:NT_113948.1  LN:92689
@SQ SN:NC_000006.12 LN:170805979
@SQ SN:NC_000007.14 LN:159345973
@SQ SN:NC_000008.11 LN:145138636
@SQ SN:NC_000009.12 LN:138394717

please resolve the issue.

next-gen alignment software error

what is the version of samtools ?

what is the output of the following command

$ file sample_mapped_and_unmapped.bam

Currently I am on leave. You are requested to kindly wait for a week or till 14 so that I can reply to the next part of the question.

Please avoid phrases such as "please resolve the issue" or "wait for a few days". Such time/urgency related statements do not come across as professional on a forum.

The ouput of the command

$ file sample _mapped and unmapped. bam

is

sample_mapped and unmapped.bam : data

Please tell what this output signify? Is there any issue with bam file?

this is NOT a bam file. The output of file sample _mapped and unmapped. bam shouldn't be data but: gzip compressed data, extra field or BAM file version...

I tried with all my samples, but still I am struggling with same issue. All the commands are running perfectly ,even the bam file generated is having size in Gb but why I am lacking i am not getting. Even other people of my lab are running the same tool and they are not facing this issue .

0 answers

No answers yet.

Log in to answer this question.