SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wig liftover and conversion rlh60 Bioinformatics 6 11-04-2013 05:17 AM
gff/bed/anything to .wig conversion? JohnK Bioinformatics 10 02-22-2013 01:32 PM
From bam to wig format mhadidi2002 Bioinformatics 1 02-17-2012 03:26 AM
casava 1.8 bam conversion to gatk bam kingsalex Bioinformatics 1 02-14-2012 11:47 AM
conversion tool sam to wig jasonbcold Bioinformatics 3 04-18-2011 05:01 AM

Reply
 
Thread Tools
Old 11-02-2010, 06:27 AM   #1
kalidaemon
Member
 
Location: Boston

Join Date: Sep 2010
Posts: 14
Default .bam to .wig conversion

I'm trying do some sanity checks by putting my TopHat output on the UCSC browser. In order to do this, I need to convert my accepted_hits.bam files to .wig files. Has anyone tried to do this? I know you can do this with SAMtools for .sam files and I was wondering if you can do the same for .bam. If not, what other tools do people use? Also, older TopHat output generated .wig files. Is there any way to get newer builds to do this? Thanks!
kalidaemon is offline   Reply With Quote
Old 11-02-2010, 07:37 AM   #2
natstreet
Member
 
Location: Sweden

Join Date: Nov 2009
Posts: 83
Default

I've resorted to converting the .bam file to -sam and using the wiggles program that comes with tophat to create the .wig files but this is hugely inefficient. I really wish they had kept the creation of wig files as standard or that wiggles could be updated to also accept .bam files as input. Then again, I also wish they hadn't dropped support for GFF3 in favour of GFF2!
natstreet is offline   Reply With Quote
Old 11-02-2010, 08:54 AM   #3
dawe
Senior Member
 
Location: 4530'25.22"N / 915'53.00"E

Join Date: Apr 2009
Posts: 258
Default

Quote:
Originally Posted by kalidaemon View Post
I'm trying do some sanity checks by putting my TopHat output on the UCSC browser. In order to do this, I need to convert my accepted_hits.bam files to .wig files. Has anyone tried to do this? I know you can do this with SAMtools for .sam files and I was wondering if you can do the same for .bam. If not, what other tools do people use? Also, older TopHat output generated .wig files. Is there any way to get newer builds to do this? Thanks!
You can try genomeCoverageBed from bedtools suite, it's able to read bam and generate bedgraph files.

d
dawe is offline   Reply With Quote
Old 11-02-2010, 09:44 AM   #4
RockChalkJayhawk
Senior Member
 
Location: Rochester, MN

Join Date: Mar 2009
Posts: 191
Default

Quote:
Originally Posted by natstreet View Post
I've resorted to converting the .bam file to -sam and using the wiggles program that comes with tophat to create the .wig files but this is hugely inefficient. I really wish they had kept the creation of wig files as standard or that wiggles could be updated to also accept .bam files as input. Then again, I also wish they hadn't dropped support for GFF3 in favour of GFF2!
I think the reason for dropping wiggle tracks is because they are massive and the server gets bogged down with trying to import all that data. Besides, BAM files can be visualized directly on UCSC - if you can put them on a web-accessible server.
RockChalkJayhawk is offline   Reply With Quote
Old 11-02-2010, 11:35 AM   #5
mgogol
Senior Member
 
Location: Kansas City

Join Date: Mar 2008
Posts: 197
Default

If anyone's using bedtools genomeCoverageBed for this, don't forget to use the -split parameter if you're using it with tophat bam files, otherwise the junction reads get stretched across the introns weirdly.



The commands I ended up using were

Code:
genomeCoverageBed -split -bg -ibam accepted_hits.sorted.bam -g dm3.chrom.sizes > accepted_hits.bedgraph
wigToBigWig accepted_hits.bedgraph dm3.chrom.sizes myfile.bw
mgogol is offline   Reply With Quote
Old 02-06-2012, 11:12 AM   #6
anagari
Member
 
Location: ??

Join Date: Jun 2011
Posts: 18
Default Prob with visualization even after using split

Hi,

I used the command as you have suggested to split the reads over the splice junctions:
./genomeCoverageBed -split -bg -ibam ip_sorted.bam -g genome_hg19.txt > accepted_hits.bedgraph

#genome_hg19.txt has the chromosome sizes for hg19.

But, when I upload the bedgraph onto Genomebrowser, it still shows stretch of reads between peaks.

Could you suggest where the problem might be?

Thanks in advance!
anagari is offline   Reply With Quote
Old 05-10-2012, 10:37 AM   #7
shenr
Junior Member
 
Location: USA

Join Date: Apr 2008
Posts: 1
Default

This issue bothered me for a while too when I used bedtools v2.13, in which -split didn't work.

The fix is actually simple: just download the new version bedtools (v2.16.2) and re-run it.

Quote:
Originally Posted by anagari View Post
Hi,

I used the command as you have suggested to split the reads over the splice junctions:
./genomeCoverageBed -split -bg -ibam ip_sorted.bam -g genome_hg19.txt > accepted_hits.bedgraph

#genome_hg19.txt has the chromosome sizes for hg19.

But, when I upload the bedgraph onto Genomebrowser, it still shows stretch of reads between peaks.

Could you suggest where the problem might be?

Thanks in advance!
shenr is offline   Reply With Quote
Old 05-10-2012, 02:39 PM   #8
anagari
Member
 
Location: ??

Join Date: Jun 2011
Posts: 18
Default

@Shenr: Thanks a lot!! Updating bedtools to 2.16 did work!!
anagari is offline   Reply With Quote
Reply

Tags
.bam, .wig, 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 08:55 PM.


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