Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to convert sam to bam with EOF marker in header

    I aligned short reads by an nonpublished aligner. Then I converted the
    alignments to sam, then bam, and sote bam. It looks they worked for
    me. But, when I intend to index and mpileup bam of multiple samples to
    call variant. I faced a problem, I got errors:

    $ samtools index maplistbam-sorted.bam
    [bam_header_read] EOF marker is absent.
    [bam_index_core] truncated file? Continue anyway. (-2)

    I did these analysis using SAMtools-0.1.6, and it is said that the
    updated verison of SAMtools can add header when converting sam to bam.
    So, now I updated SAMtools to SAMtools-0.1.12. And I want to reconvert
    my sam to bam. But, I am not sure how to do that.

    (1) Can I use this command:
    samtools view -bht my.fa.fai my.sam > my.bam

    (2) Do I need add other arguments in the command?

    (3) Please also help me to check if my sam file is a good one.

    I need your helps. Thanks in advance.

    Jian-Feng

    Following is my old bam header:
    $ samtools view -H maplistbam-sorted.bam
    [bam_header_read] EOF marker is absent.
    @SQ SN:1 LN:33132539
    @SQ SN:2 LN:19320864
    @SQ SN:3 LN:24464547
    @SQ SN - - - - - - - - - -

    My sam looks like this:
    110210010374503018 67 1 1 0 68M1D3M1I3M
    * 0 0
    TCACTTTCACTTCTGGATGCTTGTGGTTAAACACCTCACCATTCCTGTTCAACTCCTCCCCCTGTTTCGTTCCCG
    CCCCCCCCCCCCCCCACCCCCCCDC##################################################
    MD:Z:26A2T38^A3N1A1
    110211181203212143 67 1 4 0 101M *
    0 0
    CTTTCACTTCTGGATGCTTGTGGATATACACCTCACCATTCCTGTTCAACTCCTCCCCCTGTTTCAGTTCAGCAAAAGTTTAACTCTGCGGACGGCATCTA
    CCCCCCCCCCCCCCCCCCCCDCCCCCCCCCCDCCCDDBBCBCC@DCBCDDCBBCDBB>@>ABBDDBDCBBBDBBBDCBABBBACAB>>B-8A?A?CAA:BB
    MD:Z:101
    110210940527208528 137 1 5 0 101M *
    0 0
    TTTCACTTCTGGATGCTTGTGGATATACACCTCACCATTCCTGTTCAACTCCTCCCCCTGTTTCAGTTCAGCAAAAGTTTAACTCTGCGGACGGCATCTAC
    @@BBA@B=@ABBB=>@@B@B=BBBBBBBBBBBBBBBBB@BBB>@BBBBB@@@@BBB==:B<@B@@@-@@:>@@B@A@@9AABB@B:/2/?BABBA<4@/>B
    MD:Z:101
    110210850423407552 153 1 6 0 95M *
    0 0
    TGCCGTCCGCAGAGTTAAACTTTTGCTGAACTGAAACAGGGGGAGGAGTTGAACAGGAATGGTGAGGTGTATATCCACAAGCATCCAGAAGTGAA
    CCCCCCCCCCCCCCCCCCCCCCCCCCC8CCCCCCACCCCCCACA@@:CBBACCCCCCBA<CB.@>:6(9(;@@:<B@BCDBDB@D@>B@9@0@6@
    MD:Z:95
    503410211145216346 153 1 6 0 101M *
    0 0
    GGTAGATGCCGTCCGCAGAGTTAAACTTTTGCTGAACTGAAACAGGGGGAGGAGTTGAACAGGAATGGTGAGGTCTATATCCACAAGCATCCAGAAGTGAA
    <<9'<AAAAACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCD@@@CBCCACCCCC@<CCCABBCB9CBBBBBADAB@CBBB?AB;BA5?5<>:
    MD:Z:26C74
    503410941820117468 153 1 7 0 85M *
    0 0
    CATCAATACTCTTTTGCTGAACTGAAACAGGGGGAGGAGTTGAACAGGAATGGTGAGGTGTATATCCACAAGCATCCAGAAGTGA
    CCCCCCCCCCCCCCCBCCCCCCCCCCCCC6CCCCBBB:CBCCCCCCCC?CCCC@C?BB*B+;<?

  • #2
    Code:
    [bam_header_read] EOF marker is absent.
    It is not that it adds a header, it adds an EOF marker.
    If you start from your SAM alignments and with the latest version
    of samtools you won't have problems to generate the index. Try it out.

    The command that you show to convert to bam is fine.
    -drd

    Comment


    • #3
      Thanks drio,

      It is now working in the server. I hope it works this time.

      Comment

      Latest Articles

      Collapse

      • seqadmin
        Recent Advances in Sequencing Analysis Tools
        by seqadmin


        The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
        05-06-2024, 07:48 AM
      • seqadmin
        Essential Discoveries and Tools in Epitranscriptomics
        by seqadmin




        The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
        04-22-2024, 07:01 AM

      ad_right_rmr

      Collapse

      News

      Collapse

      Topics Statistics Last Post
      Started by seqadmin, Today, 06:35 AM
      0 responses
      12 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, Yesterday, 02:46 PM
      0 responses
      18 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-07-2024, 06:57 AM
      0 responses
      17 views
      0 likes
      Last Post seqadmin  
      Started by seqadmin, 05-06-2024, 07:17 AM
      0 responses
      19 views
      0 likes
      Last Post seqadmin  
      Working...
      X