sr320 / ceabigr

Workshop on genomic data integration with a emphasis on epigenetic data (FHL 2022)
4 stars 2 forks source link

Replace % meth data based on SNP presence #30

Closed yaaminiv closed 2 years ago

yaaminiv commented 2 years ago

Notebook: https://github.com/sr320/ceabigr/blob/main/code/General-Methylation-Landscape.ipynb

I have a bedgraph with % methylation values for each sample, and a VCF file for each sample that lists SNPs. For each CpG locus in the be graph that is listed as a SNP in the VCF file, I want to replace the % methylation value with 0.

I've gotten as far as intersectBed. How do I use the information I generate with intersectBed to replace values in my bedgraph?

!{bedtoolsDirectory}intersectBed \
-u \
-a 3F_R1_val_1_bismark_bt2_pe.SNP-results.vcf \
-b 3F_R1_val_1_5x.sort.bedgraph \
| grep "C   T"
sr320 commented 2 years ago

@yaaminiv can you provide us with those two files to play with?

yaaminiv commented 2 years ago

vcf: https://gannet.fish.washington.edu/seashell/bu-github/nb-2022/C_virginica/analyses/bsnp01/3F_R1_val_1_bismark_bt2_pe.SNP-results.vcf

uploading bedgraph to gannet now...may take a while

laurahspencer commented 2 years ago

My notebook where I add zeros to some loci for some populations. Lots of code here, the pertinent code to make the replacements starts at line 306

https://github.com/sr320/paper-oly-mbdbs-gen/blob/master/code/01-methylkit.Rmd

yaaminiv commented 2 years ago

@shellytrigg answered my question in this issue: https://github.com/sr320/ceabigr/issues/33