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.
• 3,603 views
•
link
2 answers
sed -e "s/_/\t/g" -e "s/ /\t/g" input.txt > output.bedGraph
Then you can use bedgraphToBigWig.
• 1 views
•
link
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)
• 1 views
•
link
Log in to answer this question.
Converstion of BED with scores into bigWig