SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
To convert BAM file to BED file Anjali Bioinformatics 10 04-28-2014 04:43 AM
SAM file without a header. Can't convert to BAM Malfet Bioinformatics 6 01-17-2013 08:39 AM
how to convert SAM file to BED or MUT marufdu07 General 2 02-07-2012 02:20 AM
How to convert a bam file to sam file badhikari Bioinformatics 2 04-01-2011 08:56 AM
How to convert Eland file to BAM or SAM? fanshu Bioinformatics 0 10-30-2010 11:46 PM

Reply
 
Thread Tools
Old 02-04-2014, 07:20 AM   #1
roll
Member
 
Location: UK

Join Date: Aug 2009
Posts: 38
Default How to convert sam/bam or bed file into wig file

Hi,

How what tools can I use to convert sam/bam or bed file into a wig file?
roll is offline   Reply With Quote
Old 02-04-2014, 08:22 AM   #2
id0
Senior Member
 
Location: USA

Join Date: Sep 2012
Posts: 130
Default

There are several options. I use bedtools genomeCoverageBed to convert from BAM to BedGraph. Then bedGraphToBigWig to convert BedGraph to BigWig.

Maybe someone else knows of a single step option.
id0 is offline   Reply With Quote
Old 02-04-2014, 12:33 PM   #3
lindenb
Senior Member
 
Location: France

Join Date: Apr 2010
Posts: 143
Default

I wrote a Bam2wig : https://github.com/lindenb/jvarkit/wiki/Bam2Wig
It use the cigar elements to get the depth.

( however, I did not often used it)
lindenb is offline   Reply With Quote
Old 02-04-2014, 01:15 PM   #4
Wallysb01
Senior Member
 
Location: San Francisco, CA

Join Date: Feb 2011
Posts: 286
Default

if this is RNA-seq data, be sure to use the -splice option for genomeCoverageBed
Wallysb01 is offline   Reply With Quote
Old 02-05-2014, 02:04 AM   #5
roll
Member
 
Location: UK

Join Date: Aug 2009
Posts: 38
Default

Quote:
Originally Posted by id0 View Post
There are several options. I use bedtools genomeCoverageBed to convert from BAM to BedGraph. Then bedGraphToBigWig to convert BedGraph to BigWig.

Maybe someone else knows of a single step option.
This is chip-seq data and i used the following commands

1. bedtools genomecov -bg -ibam Mysorted.bam > Mysorted.bedGraph

2. bedgraphToBigWig in.bedGraph chrom.sizes out.bw

At step 2, I am not sure if I understand what is the chrom.sizes file is. Shall i just create one myself simply subtracting end position from the start position to create the chrom.sizes?
I guess 'in.bedGraph' is my Mysorted.bedGraph.

Am i missing something?
roll is offline   Reply With Quote
Old 02-05-2014, 04:43 AM   #6
roll
Member
 
Location: UK

Join Date: Aug 2009
Posts: 38
Default

When i do the above, i tried to upload it to UCSC genome browser as custom track but it says it cant read my bigwig file.
I converted my bigwig to wig, this time it gives memory error.

Any ideas why this might be happening? or how to fix it?
roll is offline   Reply With Quote
Reply

Tags
bam, bed, convert, sam, wig

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:42 PM.


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