SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie Question: [bam_header_read] EOF marker is absent. oiiio Bioinformatics 14 05-28-2017 05:34 AM
sam to bam conversion error, no @SQ lines in the header, missing header? efoss Bioinformatics 17 12-03-2015 04:28 AM
cufflinks. [bam_header_read] EOF marker is absent epistatic Bioinformatics 2 11-10-2011 04:22 AM
.SAM to .BAM with SAM file header @PG emilyjia2000 Bioinformatics 13 06-14-2011 12:21 PM
sam/bam header lines keebs42 Bioinformatics 1 08-21-2009 11:25 AM

Reply
 
Thread Tools
Old 12-17-2010, 03:15 AM   #1
jianfeng.mao
Member
 
Location: germany

Join Date: Dec 2010
Posts: 12
Default 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+;<?
jianfeng.mao is offline   Reply With Quote
Old 12-17-2010, 05:20 AM   #2
drio
Senior Member
 
Location: 4117'49"N / 24'42"E

Join Date: Oct 2008
Posts: 323
Default

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
drio is offline   Reply With Quote
Old 12-17-2010, 05:56 AM   #3
jianfeng.mao
Member
 
Location: germany

Join Date: Dec 2010
Posts: 12
Default

Thanks drio,

It is now working in the server. I hope it works this time.
jianfeng.mao is offline   Reply With Quote
Reply

Tags
bam, convert, header, sam

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 03:11 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO