This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Create A Fixed Step Wig File From A Bam File?

Hi all,

I just want to know how to create a fixed step wig file from a bam file. I read a lot but couldnt find the answer. I want to create several wigs with the same row and position with the signal values.

What is the easiest way?

Thanks a lot. L

2 answers

This is a quick answer that I may be able to fill in later.

You can convert the BAM file into a bedGraph coverage file using 'bedtools genomecov' using the '-ibam' flag to input the BAM file and the '-bg' flag to output as a bedGraph. You will also need the length of the chromosomes/contigs of your reference sequence.

For the next step you can use a script that I have previously used to convert bedGraph to fixed WIG (http://davetang.org/wiki/tiki-index.php?page=wig). Be aware that this creates a nucleotide resolution WIG file so it will be huge. You can either take every 10th line or alter the code somehow.

I hope this helps.

Thank you, Ian. I'll give it a try. I used igvtools count to create X windowed wigs, but it differs between expreiments in rows.

L

Log in to answer this question.