Question: TRUNCATED FILE CREATION when samtools is used to produce both_ends_unmapped.bam from sample.bam
0
gravatar for priya120195
23 days ago by
priya1201950 wrote:

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.

ADD COMMENTlink modified 5 days ago • written 23 days ago by priya1201950

what is the version of samtools ?

what is the output of the following command

$ file sample_mapped_and_unmapped.bam
ADD REPLYlink written 23 days ago by Pierre Lindenbaum116k

Samtools version 1.4

ADD REPLYlink written 17 days ago by priya1201950

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.

ADD REPLYlink written 17 days ago by priya1201950

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.

ADD REPLYlink written 5 days ago by RamRS20k

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?

ADD REPLYlink modified 5 days ago by RamRS20k • written 14 days ago by priya1201950
1

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...

ADD REPLYlink modified 5 days ago • written 5 days ago by Pierre Lindenbaum116k

Please help me in resolving my query

ADD REPLYlink written 5 days ago by priya1201950
Please log in to add an answer.

Help
Access

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