SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
samtools merge bair Bioinformatics 5 10-10-2012 01:51 PM
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 06-21-2011, 07:02 AM   #1
frymor
Senior Member
 
Location: Germany

Join Date: May 2010
Posts: 150
Unhappy samtools merge

Hallo everybody,

I am running a bowtie assembly for drosophila.
After the bowtie is finished I'm piping the unmapped reads to tophat to see if I can map some more reads onto the same reference genome.

The sam out from bowtie I than convert into bam and tophat make automatically a bam file
After finishing both runs, I would like to combine both bam files with the samtools merge command:

Code:
samtools merge -h dilptotal.sam dilptotal_2.bam dilptotal_bowtie.bam dilp_tophat.bam
but I'm keep getting this error message:
Code:
[bam_merge_core] different target sequence name: 'YHet' != '2L' in file 'dilp_tophat.bam'
I don't exactly understand what this error means.

I used for both runs the same reference genome. in both there are the chromosomes "2L' and 'YHet'.
YHet is the heterochromatin part of the Y chromosome. It comes 4 times in the sorted bowtie bam file but over 4500 times in the sorted tophat bam file.
'2L' reads I have many millions in both files.

why does it has this problem? Is it because I don't have a header in my tophat output file with the chromosomes (@SQ)?

can I set tophat to have an header in the sam or bam files?

Thanks for ant advice,

Assa
frymor is offline   Reply With Quote
Old 06-21-2011, 10:10 AM   #2
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

Make sure that the SQ lines in the header are the same (use samtools view -H). You will also need to sort them before merging (samtools sort).
nilshomer is offline   Reply With Quote
Old 06-21-2011, 11:17 PM   #3
frymor
Senior Member
 
Location: Germany

Join Date: May 2010
Posts: 150
Default

Quote:
Originally Posted by nilshomer View Post
Make sure that the SQ lines in the header are the same (use samtools view -H). You will also need to sort them before merging (samtools sort).
This is exactly my problem. tophat produces no header in the bam file.

Can I change the setting so that tophat will create a header?
Is there a header in the (temporary) sam files from tophat?

Is it enough just to copy paste the header from the bam file from bowtie into the one from tophat?
frymor is offline   Reply With Quote
Old 10-06-2011, 03:23 AM   #4
hbt
Member
 
Location: UK

Join Date: Jan 2011
Posts: 20
Default

Quote:
Originally Posted by frymor View Post
This is exactly my problem. tophat produces no header in the bam file.

Can I change the setting so that tophat will create a header?
Is there a header in the (temporary) sam files from tophat?

Is it enough just to copy paste the header from the bam file from bowtie into the one from tophat?
I'd love to know the answers to this too!

cheers
hbt is offline   Reply With Quote
Old 10-26-2011, 05:12 AM   #5
ozs2006
Member
 
Location: rishon le zion ,israel

Join Date: May 2010
Posts: 21
Default

I got similar problem:

I downloaded sam files from recent published study.
Each sam file contains alignments of the reads to a single chromosome (hg19).
I want to merge alignments into one file.
Every sam file have only @SQ as header of its chromosome.

For example:
in chrY.sam
@SQ SN:chrY LN:59373566
in chrM.sam
@SQ SN:chrM LN:16571

I used:
samtools view -T /data/pipeline_in/Genomes/Human_GRCh37/all.fa -Sb chrY.sam | samtools sort - chrY.sam.sorted
samtools view -T /data/pipeline_in/Genomes/Human_GRCh37/all.fa -Sb chrM.sam | samtools sort - chrM.sam.sorted

Then in order to merge them:
samtools merge out chrM.sam.sorted.bam chrY.sam.sorted.bam

I got this error:
[bam_merge_core] different target sequence name: 'chrM' != 'chrY' in file 'chrY.sam.sorted.bam'

What I need to do?
from searching the net I got some clues this error is connected to the header?
Do I need to replace the headers of the primary sam files?
Where I find proper example for header?

Thanks in advance,
Oz Solomon
ozs2006 is offline   Reply With Quote
Reply

Tags
bowtie, error, output, samtools merge, tophat

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 10:48 AM.


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