SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
samtools merge frymor Bioinformatics 4 10-26-2011 05:12 AM
samtools merge nans_bn Bioinformatics 2 07-22-2011 04:45 AM
Samtools Merge and rmdup AvinashP Bioinformatics 2 06-28-2010 02:16 AM
Samtools merge wangzkai Bioinformatics 1 05-01-2010 01:35 PM
samtools merge bair Bioinformatics 4 03-05-2010 01:23 AM

Reply
 
Thread Tools
Old 02-05-2010, 08:16 AM   #1
bair
Member
 
Location: London

Join Date: Jan 2010
Posts: 65
Default samtools merge

I'm going to merge > 50 alignment bam files (is it possible to merge this number of bam files?), it's too big,
thus I want to merge by chromosome.

1. samtools view -u file1.bam chr1 > chr1.file1.bam
2. samtools view -u file2.bam chr1 > chr1.file2.bam

no problem to create the above two files.

3. samtools merge chr1.bam chr1.file1.bam chr1.bam


[bam_header_read] EOF marker is absent.


Since the merged file looks ok,

What does this information mean?

thanks
bair is offline   Reply With Quote
Old 02-05-2010, 07:39 PM   #2
lh3
Senior Member
 
Location: Boston

Join Date: Feb 2008
Posts: 693
Default

It means either a) you BAM is generated by an old version of samtools; or b) your BAM is truncated.
lh3 is offline   Reply With Quote
Old 02-06-2010, 04:03 PM   #3
bair
Member
 
Location: London

Join Date: Jan 2010
Posts: 65
Default

Quote:
Originally Posted by lh3 View Post
It means either a) you BAM is generated by an old version of samtools; or b) your BAM is truncated.
I uased bowtie for alignment, and convert it's sam output to bam by samtools.

Thanks.
bair is offline   Reply With Quote
Old 10-10-2012, 12:21 PM   #4
rahilsethi
Member
 
Location: Pittsburgh, PA

Join Date: May 2010
Posts: 22
Question samtools merge problem

Hi,

I am having the same problem as blair had when used samtools merge:

[bam_header_read] EOF marker is absent. The input is probably truncated.

I also followed the same steps

1. Files: bam1_sorted_indexed.bam, bam2_sorted_indexed.bam
2. Merge: samtools merge -u output.bam bam1_sorted.bam bam2_sorted.bam

Merge files with no problem, but further running samtools on merged bam file such as samtools sort or samtools depth gives the above "EOF marker absent" warning, though it does produce the output.

When using Picard I did not have such problem, but Picard seems to be not able to handle large eg. if bam1 >= 8G or bam2 >= 8G, where it breaks and gives runtime error. In those cases one might have to rely on samtools merge. Should I be concerned about the above warning samtools gives?
rahilsethi is offline   Reply With Quote
Old 10-10-2012, 12:25 PM   #5
rahilsethi
Member
 
Location: Pittsburgh, PA

Join Date: May 2010
Posts: 22
Default

to add to the above
a) my bam files are generated by the same samtools version as the merged file and also for the sort and depth activities (0.1.18)
b) my bam files are also not truncated since Picard can run fine
rahilsethi is offline   Reply With Quote
Old 10-10-2012, 01:51 PM   #6
swbarnes2
Senior Member
 
Location: San Diego

Join Date: May 2008
Posts: 912
Default

It might be the -u in your command line.

If you do something like this:

Quote:
samtools view -bShu file.sam > file.bam
samtools sort file.bam sort
samtools will complain that there is no EOF marker. But it still works fine.
swbarnes2 is offline   Reply With Quote
Reply

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 06:50 AM.


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