This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error: Eof Marker Is Absent When Processing A Bam File

Hi

I work with HAPCUT software to make Haplotypes using a sorted bam file and a vcf file containing variants. When I run this command,

./extract_hairs --VCF variantfile.VCF --bam alignedreads.sorted.bam --maxIS 600 > fragment_matrix_file

an error says that

[bam_header_read] EOF marker is absent

Also before that, when I tried to sort bam file with samtools this error occurred. but samtools continued to make sorted bam and then I used it in HAPCUT.

Thanks for any advice on this problem.

samtools

HAPCUT is interesting. How long are the haplotypes it generates from paired-end sequencing data?

If you get this error. You can maybe ask yourself if the bam file you created was created in a perfect manner. If I get this error, I'll always look at the sam file, and convert it to a bam file again. Don't run things in parallel, since this can result in errors. After this conversion, sort your bam file and then perform indexing again. Normally you won't run into this problem afterwards.

A good pipeline converts alignment stream to BAM right away, with or without multithreading does not matter. If the file is corrupt then because of memory shortages or corruption during the alignment.

2 answers

You have an invalid bamfile. Recreate it.

But I download my bamfile from this link: "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/data" I think that problem is from other thing. I work with some variant somtool to create sorted file for using in HAPCUT, but error occurred every time.Is it possible that samtool do not work correctly? or my error is from other thing? thanks,

If samtools raises an error then it means that your bamfile is incorrect. There are many ways a download can go bad, give us the link to the actual bamfile and perhaps someone can test it for you on their system.

If hard drive was full when made bam file it would stop but not give any indication so maybe the person that made the bam file did not notice that during the operation the hard drive became full. Try to get the sam file and convert yourself or use a different bam file to check it is the bam file which is not complete. I recently created a bam file but my hard drive was full so had this issue.

Even though the file will be sorted using samtools it is not the complete bam file so your results will not be based upon the full data set.

Log in to answer this question.