SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
BWA sam and Samtools sam->bam conversion problem maasha Bioinformatics 6 06-05-2013 07:39 AM
454 .ace to .bam conversion issue pmiguel Bioinformatics 14 06-23-2011 11:30 PM
.SAM to .BAM with SAM file header @PG emilyjia2000 Bioinformatics 13 06-14-2011 12:21 PM
NEw to Chip-seq and have .bam/.sam/.bam.bai files... then what? NGS newbie Bioinformatics 11 05-25-2011 07:48 AM
TOPHAT EMPTY accepted_hits.bam ISSUE waterboy Bioinformatics 1 11-16-2010 08:48 AM

Reply
 
Thread Tools
Old 08-27-2012, 01:46 PM   #1
rndouglas
Member
 
Location: USA

Join Date: Jun 2012
Posts: 23
Default SAM to BAM conversion issue

All of a sudden a problem with SAM to BAM conversion has cropped up for me.

I used Bowtie 1 to map sRNA reads to a sequence of interested and had a SAM file outputted:

Code:
@HD	VN:1.0	SO:unsorted
@SQ	SN:centc	LN:11067
@PG	ID:Bowtie	VN:0.12.8	CL:"bowtie -f -S --al /Users/birchlerlab/Desktop/TB9Sb1_centc_aligned.fa /Users/birchlerlab/Desktop/maize_centromeres/centc.fa /Users/birchlerlab/Desktop/TB9SB1_filtered_18_28nt.fa"
CTATAAGTCTGTGAAGGTGTCTT	4	*	0	0	*	*	0	0	CTATAAGTCTGTGAAGGTGTCTT	IIIIIIIIIIIIIIIIIIIIIII	XM:i:0
AAGGGGTCGACACAGTTTAGCATG	4	*	0	0	*	*	0	0	AAGGGGTCGACACAGTTTAGCATG	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
CCTTCTATCGACGGAGCAGGACGCC	4	*	0	0	*	*	0	0	CCTTCTATCGACGGAGCAGGACGCC	IIIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
CATAACGAAGAAACCCTAGCCT	4	*	0	0	*	*	0	0	CATAACGAAGAAACCCTAGCCT	IIIIIIIIIIIIIIIIIIIIII	XM:i:0
ATGAATGTAGATGAAGGGAACTCA	4	*	0	0	*	*	0	0	ATGAATGTAGATGAAGGGAACTCA	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
GAGGATAGCCAAGAGTTCAGGGCC	4	*	0	0	*	*	0	0	GAGGATAGCCAAGAGTTCAGGGCC	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
GTGAGTTGAGAATCCATGCGGGCG	4	*	0	0	*	*	0	0	GTGAGTTGAGAATCCATGCGGGCG	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
GTGAGTTGAGAATCCATGCGGGCG	4	*	0	0	*	*	0	0	GTGAGTTGAGAATCCATGCGGGCG	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
AAGGAGAGTAAGAATTAACAGTGT	4	*	0	0	*	*	0	0	AAGGAGAGTAAGAATTAACAGTGT	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
AAGGAGAGTAAGAATTAACAGTGT	4	*	0	0	*	*	0	0	AAGGAGAGTAAGAATTAACAGTGT	IIIIIIIIIIIIIIIIIIIIIIII	XM:i:0
Everything seemed okay at that point, and I wanted to throw the output into IGV to visualize the reads when it yelled at me (rightfully so) that my SAM file was unsorted.

Aha! I thought I would just convert to BAM then sort, then go back to IGV.

So I used this to convert SAM to BAM:

Code:
samtools view -bS ~/TB9SB3.sam > ~/TB9SB3.bam
Then I went to sort the file and it finished instantly. I knew something was not right so I looked at my BAM file and it looked like garbled trash (see photo from a related sample).



Any suggestions on what I might have done to screw things up? I have installed nothing/deleted nothing since my SAM to BAM conversions were working well last week.
My previous SAM to BAM converstions were with Tophat output though. Does Bowtie output not do well with a conversion?
rndouglas is offline   Reply With Quote
Old 08-27-2012, 02:43 PM   #2
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

BAM files are compacted and compressed, so you wont be able to read them in a text viewer. Try converting back from BAM to SAM to see if you get the original SAM file.
nilshomer is offline   Reply With Quote
Old 08-27-2012, 03:10 PM   #3
rndouglas
Member
 
Location: USA

Join Date: Jun 2012
Posts: 23
Default

Of course! Thank you!

I'm guessing I just entered a bad sort command now.
rndouglas 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:27 PM.


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