Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinay052003
    Member
    • Jan 2010
    • 59

    #1

    How to correct BAM file EOF marker absent error

    Hi,
    I am trying to run bamUtils's splitBam program to split my bam file into read groups but getting the error: BGZF EOF marker is missing.
    Samtools also gives the similar error "EOF marker absent. I understand that my file is not corrupt but just an older BAM/SAM version. Is there anyway to fix these errors so that bamUtils can be run on it.
  • maubp
    Peter (Biopython etc)
    • Jul 2009
    • 1544

    #2
    Try using 'samtools view' BAM to BAM, or if you can program just append the 28 byte EOF marker. It might be possible to do that with Unix cat, if you can work out how to escape the binary values...

    Comment

    • swbarnes2
      Senior Member
      • May 2008
      • 910

      #3
      Does the "no EOF" error actually stop the SAMtools command from functioning properly? If not, I'd say just leave it be.

      Comment

      • maubp
        Peter (Biopython etc)
        • Jul 2009
        • 1544

        #4
        Originally posted by swbarnes2 View Post
        Does the "no EOF" error actually stop the SAMtools command from functioning properly? If not, I'd say just leave it be.
        The warning from samtools is harmless (but scary - and if you get in the habit of ignoring it you may miss a truly truncated file).

        I don't know if bamUtils is less tolerant and simply aborts.

        Comment

        • vinay052003
          Member
          • Jan 2010
          • 59

          #5
          Thanks maub for the replies.
          bamUtils simply aborts the program.. which is somewhat annoying. I have large bam files from whole genome. Now converting them to newer version with samtools takes hours.
          Both Samtools and Picard can easily process "EOF absent" files.

          Comment

          • maubp
            Peter (Biopython etc)
            • Jul 2009
            • 1544

            #6
            You should probably contact the bamUtils authors to treat this as a warning not an error.

            If you are going to use the 'samtools view' trick to 'fix' the BAM files, can you pipe this directly into bamUtils? That should be faster (less disk IO), and if you select BAM with no compression even faster still.

            The trick of appending the missing 28 bytes EOF is probably the most efficient solution, as long as you don't mind risking editing the BAM file in situ. You could try this little Python script I just wrote - but please backup your data first and let me know if it works nicely - it has had only minimal testing: https://github.com/peterjc/picobio/b...gzf_add_eof.py
            Last edited by maubp; 04-16-2012, 01:15 PM. Reason: Link to script

            Comment

            • vinay052003
              Member
              • Jan 2010
              • 59

              #7
              I am trying to get in touch with the bamUtils authors. Thanks for the trick about piping samtools output to bamUtils and for the script as well.

              Comment

              • vinay052003
                Member
                • Jan 2010
                • 59

                #8
                Hi maubp,
                I used your script and its seems to run without any error but takes several hours before it finishes. Could it be due to the fact that my bam files are in 100gb size?

                Comment

                • maubp
                  Peter (Biopython etc)
                  • Jul 2009
                  • 1544

                  #9
                  Several hours? Wow. I haven't tried it on any files that large but that does surprise me. I can think of a few variations that might help (e.g. opening in append mode to add the block). I may have time to look at this tomorrow...

                  Comment

                  • vinay052003
                    Member
                    • Jan 2010
                    • 59

                    #10
                    Its all right.. no rush. I've got reply from bamUtil's developers and I think the problem will be fixed. Thanks a lot for the help.

                    Comment

                    • maubp
                      Peter (Biopython etc)
                      • Jul 2009
                      • 1544

                      #11
                      OK, yes, I could reproduce the slowness with bigger files (and found it didn't seem to work as expected on Mac OS 10.6 which I'd not tried before).

                      A slight difference to use append mode explicitly worked wonders - it should now be sub-second as I originally intended. Could you retry (again, backup the data first - this does edit in place and is new code):


                      Note this is now v0.0.1 (the original you tried I have dubbed v0.0.0).

                      Comment

                      • vinay052003
                        Member
                        • Jan 2010
                        • 59

                        #12
                        I'll give it a shot and let you know. Actually I forgot to mention that I was using Mac Osx as well.

                        Thanks.

                        Comment

                        Latest Articles

                        Collapse

                        • SEQadmin2
                          Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                          by SEQadmin2



                          Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                          Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                          ...
                          Today, 09:55 AM
                        • SEQadmin2
                          New Genomics Technologies Take Aim at Long-Standing Limits
                          by SEQadmin2


                          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                          ...
                          09-28-2026, 10:25 AM

                        ad_right_rmr

                        Collapse

                        News

                        Collapse

                        Topics Statistics Last Post
                        Started by SEQadmin2, Today, 05:39 AM
                        0 responses
                        10 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, Yesterday, 09:56 AM
                        0 responses
                        12 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 10-09-2026, 11:14 AM
                        0 responses
                        26 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 09-29-2026, 09:51 AM
                        0 responses
                        77 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...