Is there an easy way to convert a .wig file to an rpkm file?
Is there an easy way to convert a .wig file to an rpkm file?
I don't think so. It wouldn't be easy at least. You could probably code something up to get close to the right conversion, if you know how long your reads are.
Wiggle format lets you know coverage on a per base-pair level. The idea of a read in wiggle format is abstracted out to the idea of an alignment column, and how many aligned bases are in that column.
RPKM on the other hand is a measure of the number of reads mapping to a feature, usually a gene. To get RPKM from a wiggle file, you would have to figure out how many reads are mapping to each gene from the coverage data. If you know the length of each read, then this could be calculated from the wiggle.
So you could take a gene and sum the values in the wiggle file overlapping the exons of that gene. This gives you the total number of read bases that align to that gene. Now if you know either 1) the exact read length of all of your reads (like you do with illumina) or 2) there is a relatively tight distribution of lengths, then you can approximate the number of reads mapping to that gene by dividing by the read length (or mean read length).
Now that you have a good approximation of the number of reads mapping to each gene from the wiggle file, you could calculate RPKM.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.