# Oly methylation analysis, some general characteristic questions

I’m exploring the Oly MBD-Seq data to compare general methylation characteristics in O. lurda compared to other oysters. Here are a couple questions I investigated recently:

### Question: Does gene length ~ # isoforms?

If so, a CpG could be more likely since it’s longer. This could be a weird artifacts of transcriptome assembly could lead to genes having multiple isoforms - e.g. long. Here’s code from the 01c-Generating-meth-feature-files.Rmd notebook (where I produce the isoform feature files).

``````#ggplotly(
ASV.per.gene %>% mutate(length_gene=stop_gene-start_gene) %>%
ggplot() + geom_boxplot(aes(x=as.factor(isoform_count), y=length_gene))
#)
``````

#### My take: yes, gene length increases with isoform number for genes with ~1-15 isoforms. Then, there’s no relationship. ### Question: Are longer genes more methylated?

Wang et al. 2014 found a positive association between gene length and methylation rate. Do I? Could that relate to the isoform relationship? Here I plot % of CpGs in a gene methylated, by gene length.

``````library(data.table)

left_join(
fread(here::here("analyses", "methylation-characteristics", "methylated-gene2kb.bed"), sep = "\t", select=c(5,8,9)) %>%
count(V5, V8, V9) %>%  setNames(c("contig_gene", "start_gene", "end_gene", "n_mCpG")),

count(V10, V13, V14) %>%  setNames(c("contig_gene", "start_gene", "end_gene", "n_CpG")),

by=c("contig_gene", "start_gene", "end_gene")) %>%

mutate(length_gene=end_gene-start_gene, perc_meth=100*(n_mCpG/n_CpG)) %>%
na.omit(perc_meth) %>%
ggplot(aes(x=length_gene, y=perc_meth)) + geom_point() +
geom_smooth(method="lm")
``````

#### My take: looks like a negative relationship. HOWEVER coverage is probably an issue here (longer genes less likely to be fully sequenced). Need to figure out how to do this in MethylKit, or how to only analyze genes with good coverage. Written on December 8, 2020
{"ft_lang_label":"__label__en","ft_lang_prob":0.7568743,"math_prob":0.85003316,"size":1994,"snap":"2021-04-2021-17","text_gpt3_token_len":550,"char_repetition_ratio":0.12512563,"word_repetition_ratio":0.0,"special_character_ratio":0.27432296,"punctuation_ratio":0.19452055,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96746004,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,1,null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-01-16T18:12:38Z\",\"WARC-Record-ID\":\"<urn:uuid:f07e0cb2-64f2-4213-9c59-3adf3aad1ab0>\",\"Content-Length\":\"8248\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d6b3d637-4464-4704-96db-6dbb42e33bef>\",\"WARC-Concurrent-To\":\"<urn:uuid:1d46c794-0f86-4d66-bf86-77d968a3f591>\",\"WARC-IP-Address\":\"185.199.111.153\",\"WARC-Target-URI\":\"https://laurahspencer.github.io/LabNotebook/Oly-methylation-questions/\",\"WARC-Payload-Digest\":\"sha1:CE4RFEQLJMAD4WVCMKGEWJ4GYMCREGSE\",\"WARC-Block-Digest\":\"sha1:LWXQOK7VIDQVLLYA35IKWSP6Y4VYWLGX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-04/CC-MAIN-2021-04_segments_1610703506832.21_warc_CC-MAIN-20210116165621-20210116195621-00764.warc.gz\"}"}