![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merging bam files | memento | Bioinformatics | 1 | 02-17-2012 04:39 PM |
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 |
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 |
![]() |
|
Thread Tools |
![]() |
#1 |
Senior Member
Location: Spain Join Date: Jul 2009
Posts: 133
|
![]()
Hi,
Is it possible to merge bam files from the same sample but different reference sequence and thus different headers, so that I work with one single alignment file instead of two?. I tried Code:
java -Xmx4g -jar ~/picard-tools-1.61/MergeSamFiles.jar INPUT=Sample1_exon1.bam INPUT=Sample1_exon2.bam OUTPUT=Sample1_merged.bam ASSUME_SORTED=true USE_THREADING=true VALIDATION_STRINGENCY=LENIENT Exception in thread "main" net.sf.samtools.util.SequenceUtil$SequenceListsDifferException: Sequences at index 0 don't match Cheers, Dave p.s.: I must say that the MERGE_SEQUENCE_DICTIONARIES flag seems to be related to this task but I am not sure what it actually means Last edited by dnusol; 02-06-2012 at 08:14 AM. |
![]() |
![]() |
![]() |
#2 |
Senior Member
Location: bethesda Join Date: Feb 2009
Posts: 700
|
![]()
Even it if were possible, it wouldn't be a good idea.
Check samtools merge documentation at http://samtools.sourceforge.net/samtools.shtml merge samtools merge [-nur1f] [-h inh.sam] [-R reg] <out.bam> <in1.bam> <in2.bam> [...] Merge multiple sorted alignments. The header reference lists of all the input BAM files, and the @SQ headers of inh.sam, if any, must all refer to the same set of reference sequences. The header reference list and (unless overridden by -h) ‘@’ headers of in1.bam will be copied to out.bam, and the headers of other files will be ignored. |
![]() |
![]() |
![]() |
#3 |
Senior Member
Location: Spain Join Date: Jul 2009
Posts: 133
|
![]()
Thanks Richard,
I was afraid of that. I see it as doing two steps of alignment against two different reference files instead of doing one single alignment against a file with two fasta entries. I guess the issue here is that you loose the ability of finding reads if multiple alignment is taking place. Unless this is done in a late step. But why a bad idea? to me it seems just a technical issue (samtools will only take into account headers of first in.bam file) |
![]() |
![]() |
![]() |
Thread Tools | |
|
|