Go Back   SEQanswers > Bioinformatics > Bioinformatics

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging bam files memento Bioinformatics 1 02-17-2012 04:39 PM
merging bam files with different headers dnusol Bioinformatics 2 02-07-2012 12:09 AM
merging many bam files-novice needs help please shawpa Bioinformatics 2 01-06-2012 09:03 AM
Problem merging BAM files hlwright Bioinformatics 6 10-11-2011 12:36 AM
Calling multiple BAM files for SNPs and vcf newbietonextgen Bioinformatics 3 04-19-2011 12:29 PM

Thread Tools
Old 08-25-2011, 02:40 AM   #1
Junior Member
Location: Bern

Join Date: Aug 2011
Posts: 1
Default Merging multiple BAM files

Hello all,

We are new to using samtools and are trying to solve a problem with merging multiple BAM files.

We have several BAM files, one from each individual. They have all been mapped (one at a time) to the same reference genome, whose assembly consists of about 7000 scaffolds. Now reads from each individual map to several but not always all of the scaffolds in the reference. Therefore, for example, individual_1 may have no reads mapping to scaffold 1234 of the reference, but individual_2 might. Now we want to merge all of these alignments into a single BAM file but samtools cannot deal with the fact that some scaffold names do not match.

The BAM files were created using samtools from SAM files exported from CLC genomics workbench.

Any help will be greatly appreciated.

unibegenomics is offline   Reply With Quote
Old 08-25-2011, 03:03 AM   #2
Location: Spain

Join Date: Jul 2010
Posts: 68

I am not familiar with the importance of scaffolds in the reference genome.

However, I would recommend to try and use picard tools.
It does things similar to samtools and more.

Perform two steps:

1. AddAndReplaceReadgroups for each of your bam files (to annotate the reads and be able to follow them in the merged file).
2. MergeSamFiles. Although the tools says "sam", it also works for bam files.

good luck!
sdvie is offline   Reply With Quote

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 05:29 AM.

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