How do I make a bigwig file from a matrix of counts?
2
0
Entering edit mode
8.5 years ago
endrebak ▴ 970

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 • 3.2k views
ADD COMMENT
1
Entering edit mode
ADD REPLY
3
Entering edit mode
8.5 years ago

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

ADD COMMENT
2
Entering edit mode
8.5 years ago

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)

ADD COMMENT

Login before adding your answer.

Traffic: 933 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6