SEQanswers

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
Problem merging BAM files hlwright Bioinformatics 6 10-11-2011 12:36 AM
Merging multiple BAM files unibegenomics Bioinformatics 1 08-25-2011 03:03 AM
merging 2 sam files papori Bioinformatics 0 07-29-2011 05:44 AM

Reply
 
Thread Tools
Old 01-06-2012, 08:34 AM   #1
shawpa
Member
 
Location: Pittsburgh

Join Date: Aug 2011
Posts: 72
Unhappy merging many bam files-novice needs help please

I have 152 coordinate sorted bam files. I want to merge them. I have tried both Samtools merge and Picard. I used Samtools merge before on some different data and it worked but I don't think that data was coordinate sorted and that might make a difference. The command I am trying to use is

samtools merge /out.bam /path_to_file/*.bam

I want it to merge all the files in that folder. I don't get a specific error but it prints out the samtools merge usage parameters. So I guess I am missing something in my command. The following is what I have done so far in my pipeline:

1. aligned with bowtie 2 (output sam)
2. sorted individual sam files output to individual bam files

The end goal is to use GATK for variant analysis. According to http://seqanswers.com/wiki/How-to/exome_analysis, I need to put some kind of -r argument in Samtools when I am processing to add an @rq (or something like that).

I am lost at this moment and I have searched and searched to try and find an answer on the forums.
shawpa is offline   Reply With Quote
Old 01-06-2012, 08:51 AM   #2
cbeck
Junior Member
 
Location: Montreal

Join Date: Sep 2011
Posts: 6
Default

Hi Shawpa,
As an aside, you don't need to merge the bam files when calling the UnifiedGenotyper, you can use multiple -I parameters. Note that you can expect compute time to increase in a non-linear fashion when doing this.
cbeck is offline   Reply With Quote
Old 01-06-2012, 09:03 AM   #3
gringer
David Eccles (gringer)
 
Location: Wellington, New Zealand

Join Date: May 2011
Posts: 838
Default

Quote:
Originally Posted by shawpa View Post
samtools merge /out.bam /path_to_file/*.bam
If this is the precise command you used, you may get better results from removing the initita forward slashes.
gringer 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 01:57 PM.


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