--- title: "Chacterizing CpG Methylation" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` In this script, I'll create figures to characterize CpG methylation in my *C. virginica* gonad samples. I will use a list of CpGs with at least 5x coverage across all samples from the control pCO2 treatment. ## Session information ```{r} sessionInfo() ``` ## Import data ```{r} cpgMethylation <- read.csv("2019-04-09-All-5x-CpGs.csv", header = FALSE) #Import file with CpG methylation for all loci with 5x coverage colnames(cpgMethylation) <- c("chromosome", "start", "end", "methylation") #Add column names head(cpgMethylation) #Confirm import ``` ## Create figure ```{r} #pdf("2019-04-10-5x-CpG-Frequency-Distribution.pdf", width = 11, height = 8.5) hist(x = cpgMethylation$methylation, axes = FALSE, xlab = "", ylab = "", main = "", col = "grey80", xaxs = "i", yaxs = "i") #Create base plot axis(side = 1, col = "grey80", at = seq(from = 0, to = 100, by = 10)) #Add x-axis mtext(side = 1, text = "Methylation (%)", line = 3) #Add x-axis label axis(side = 2, col = "grey80", las = 2, labels = c("0", "2", "4", "6"), at = c(0, 2e+05, 4e+05, 6e+05)) #add y-axis mtext(side = 2, text = "Frequency (x100,000)", line = 2.5) #Add y-axis label #dev.off() ```