Ensembl / WiggleTools

Basic operations on the space of numerical functions defined on the genome using lazy evaluators for flexibility and efficiency
Apache License 2.0
144 stars 25 forks source link

Mutation rate per epigenetic state #30

Closed drmjc closed 6 years ago

drmjc commented 6 years ago

Hi, Using the ChromHMM states from Epigenomics Roadmap, I had a bigbed of the epigenomic state of each segment of the genome. I'd like to calculate the mutation rate in each genomic segment, based on the set of genome-wide variants in a single large VCF file. I can see a slow way to do this via decomposing the bigbed into one BED per state, then calculating & aggregating the mutation rate via bedtools intersect, but I was wondering if there was a clever way to do this in a single pass, directly from the bb, using WiggleTools?

many thanks, Mark

dzerbino commented 6 years ago

One possible (far-fetched) approach would be to convert your Bigbed file into a Bigwig, transforming your discrete states into numerical values. You could then paint your VCF with the local state at each base pair as such (the segmentation state will end up at the end of each line): wiggletools apply_paste - minI VCF.vcf segmentation.bw

KXin1231 commented 6 years ago

Hi, May I know how to calculate mutation rate using bedtools intersect?