![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
cufflinks. [bam_header_read] EOF marker is absent | epistatic | Bioinformatics | 2 | 11-10-2011 05:22 AM |
1000 genomes newbie question | brofallon | Bioinformatics | 1 | 06-16-2011 06:50 AM |
how to convert sam to bam with EOF marker in header | jianfeng.mao | Bioinformatics | 2 | 12-17-2010 06:56 AM |
Newbie Question Here | Schoenbrau | General | 1 | 12-05-2010 09:20 PM |
Newbie Question, Getting my Terminology in Order | Bardj | General | 0 | 01-21-2010 12:26 PM |
![]() |
|
Thread Tools |
![]() |
#1 |
Senior Member
Location: USA Join Date: Jan 2011
Posts: 105
|
![]()
What does this error mean with respect to the completion of my samtools command?
[bam_header_read] EOF marker is absent. Does it mean that the command made it to the end of the file and completed satisfactorily? But just found no specific line indicating the end of the file? |
![]() |
![]() |
![]() |
#2 |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]()
The cryptic error from samtools "EOF marker is absent" is referring to the absence of a special empty BGZF block of 28 bytes, which samtools looks for at the end of the data to indicate the BAM file is complete.
If you see that error, either: (a) Your file is somehow truncated or incomplete (a real error) (b) Your file is from a tool not writing this EOF marker (perhaps a very old samtools?) Where did your BAM file come from? |
![]() |
![]() |
![]() |
#3 |
Senior Member
Location: USA Join Date: Jan 2011
Posts: 105
|
![]()
My bam file was actually made with BWA and the most recent version of SAM. I am concerned because although i received the error, the files are the right size. I'll probably just redo them. Thanks for the clarification though
|
![]() |
![]() |
![]() |
#4 |
Member
Location: Sao Paulo, Brazil Join Date: Apr 2011
Posts: 17
|
![]()
oiio, please post the command you are trying to execute.
This message happens too if you're trying to run samtools with a SAM file instead of a BAM file. |
![]() |
![]() |
![]() |
#5 |
Senior Member
Location: USA Join Date: Jan 2011
Posts: 105
|
![]()
The command lines are very simple... samtools sort 1.bam 1.sorted ... etc
Also I don't think some of them would work if the file was still a SAM. Thanks though. Does anyone know of/practice a fast way to check a ton of BAMs for the presence of the EOF marker? |
![]() |
![]() |
![]() |
#6 |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]()
Probably this would work:
Code:
tail problem.bam | hexdump -C Code:
0x1f 0x8b 0x08 0x04 0x00 0x00 0x00 0x00 0x00 0xff 0x06 0x00 0x42 0x43 0x02 0x00 0x1b 0x00 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 |
![]() |
![]() |
![]() |
#7 |
Senior Member
Location: USA Join Date: Jan 2011
Posts: 105
|
![]()
Awesome, thanks
|
![]() |
![]() |
![]() |
#8 |
Senior Member
Location: Oxford Join Date: Feb 2012
Posts: 129
|
![]()
What if the end is 31 bytes:
1F 8B 08 04 00 00 00 00 00 FF 06 00 42 43 02 00 1E 00 01 00 00 FF FF 00 00 00 00 00 00 00 00 And by the way if you use Windows, HxD is really cool to open how ever large your BAM. Best, dong |
![]() |
![]() |
![]() |
#9 | |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]() Quote:
Edit: Recap post with current patch http://sourceforge.net/mailarchive/m...sg_id=28843382 Last edited by maubp; 02-25-2012 at 11:07 AM. Reason: Adding another URL |
|
![]() |
![]() |
![]() |
#10 |
Senior Member
Location: Oxford Join Date: Feb 2012
Posts: 129
|
![]()
Thanks Peter, you are my hero.
|
![]() |
![]() |
![]() |
#11 | |
Member
Location: NYC Join Date: Jan 2012
Posts: 12
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#12 |
Peter (Biopython etc)
Location: Dundee, Scotland, UK Join Date: Jul 2009
Posts: 1,543
|
![]()
I meant it for information only really (and as a reminder to the samtools team).
The easy answer is to be aware that this EOF warning can be a false positive. If you are interested, you'll need to learn a bit about patch files. The Unix command diff creates a list of differences, also called a patch. The Unix patch command takes these files as inputs and applies the changes to your copy of the original files. The idea is you could download the samtools source code, apply this patch (make the correction for the bug), then compile and install the fixed samtools. |
![]() |
![]() |
![]() |
#13 |
Member
Location: NYC Join Date: Jan 2012
Posts: 12
|
![]()
Thank you very much! I will look into that.
-Edwin |
![]() |
![]() |
![]() |
#14 | |
Member
Location: Seoul, Korea Join Date: Feb 2013
Posts: 57
|
![]()
I got he same error [bam_header_read] EOF marker is absent.
[bam_header_read] invalid BAM binary header (this is not a BAM file). File ./merged_asm/tmp/mergeSam_filepsu0Hv doesn't appear to be a valid BAM file, trying SAM... [11:16:29] Loading reference annotation. [11:16:55] Inspecting reads and determining fragment length distribution. Processed 39384 loci. As you can see, trying for SAM... and Loading reference annotation.. and then the process continues... My questions are 1. what if continue like this (trying SAM)? is it OK (without trying tail problem.bam | hexdump -C) ? 2. It skips the large bundle as below: [11:16:56] Assembling transcripts and estimating abundances. 6:126102153-130463972 Warning: Skipping large bundle. Processed 39383 loci. Is it okay to go for this ? or how can I add large bundle ? Quote:
|
|
![]() |
![]() |
![]() |
#15 |
Junior Member
Location: MA Join Date: Mar 2017
Posts: 7
|
![]()
Hi all,
This is a really old thread, but I have come across the same issue and I'm not sure how to fix it with the patch. I am using samtools to convert a .sam file mapped using bowtie2 to a .bam file. The .sam file looks like it's all there, but when I use the below command, something strange happens during the conversion. I'm trying to incorporate this info into the anvio pipeline and I am using the anvio-init-bam command to sort. Any ideas? $samtools view -F 4 -bS -u ecosphere_merged_MAPPING/Past_Sample_01.sam > ecosphere_merged_MAPPING/Past_Sample_01-RAW.bam [samopen] SAM header is present: 196761 sequences. $anvi-init-bam ecosphere_merged_MAPPING/Past_Sample_01-RAW.bam -o ecosphere_merged_MAPPING/Past_Sample_01.bam [28 May 17 12:34:55 SORT] Sorting BAM File... May take a while depending on the size. [W::bam_hdr_read] EOF marker is absent. The input is probably truncated. [E::bgzf_read] bgzf_read_block error -1 after 0 of 4 bytes Traceback (most recent call last): File "/usr/local/bin/anvi-init-bam", line 75, in <module> output_file_path = args.output_file,)) File "/usr/local/bin/anvi-init-bam", line 48, in init_bam_file pysam.sort("-o", output_file_path, input_file_path) File "/usr/local/lib/python3.5/dist-packages/pysam/utils.py", line 75, in __call__ stderr)) pysam.utils.SamtoolsError: 'samtools returned with error 1: stdout=, stderr=[bam_sort_core] truncated file. Aborting.\n' |
![]() |
![]() |
![]() |
Thread Tools | |
|
|