This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How do I make a bigwig file from a matrix of counts?

Let us say I have a matrix of counts like so

chr1_10000_10199 32
chr1_10200_10400 49
...

How do I most easily convert it into a bigwig format file ?

My intention is to be able to view the data above in the genome browser.

chip-seq

2 answers

sed -e "s/_/\t/g" -e "s/ /\t/g" input.txt > output.bedGraph Then you can use bedgraphToBigWig.

You can convert your input to bedgraph first then use bedGraphToBigWig from ucsc/utilities E.g., not tested:

sed 's/_/\t/g' matrix.txt | sort -k1,1 -k2,2n > matrix.bedGraph
bedGraphToBigWig matrix.bedGraph chromSizes.txt matrix.bw

(Assuming that the space between "chr1_10000_10199" and "32" is TAB, otherwise, replace space with tab also)

Log in to answer this question.