1. Environment setting

library(ggplot2)
library(scales)
library(gridExtra)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following object is masked from 'package:gridExtra':
## 
##     combine
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(dmrseq)
## Loading required package: bsseq
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:dplyr':
## 
##     combine, intersect, setdiff, union
## The following object is masked from 'package:gridExtra':
## 
##     combine
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
##     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
##     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
##     table, tapply, union, unique, unsplit, which.max, which.min
## Loading required package: GenomicRanges
## Loading required package: stats4
## Loading required package: S4Vectors
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:dplyr':
## 
##     first, rename
## The following objects are masked from 'package:base':
## 
##     expand.grid, I, unname
## Loading required package: IRanges
## 
## Attaching package: 'IRanges'
## The following objects are masked from 'package:dplyr':
## 
##     collapse, desc, slice
## Loading required package: GenomeInfoDb
## Loading required package: SummarizedExperiment
## Loading required package: MatrixGenerics
## Loading required package: matrixStats
## 
## Attaching package: 'matrixStats'
## The following object is masked from 'package:dplyr':
## 
##     count
## 
## Attaching package: 'MatrixGenerics'
## The following objects are masked from 'package:matrixStats':
## 
##     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
##     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
##     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
##     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
##     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
##     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
##     colWeightedMeans, colWeightedMedians, colWeightedSds,
##     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
##     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
##     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
##     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
##     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
##     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
##     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
##     rowWeightedSds, rowWeightedVars
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## 
## Attaching package: 'Biobase'
## The following object is masked from 'package:MatrixGenerics':
## 
##     rowMedians
## The following objects are masked from 'package:matrixStats':
## 
##     anyMissing, rowMedians
library(annotatr)
library(sechm)

2. Loading data

2.1 BSSeq objects

Loading of bsseq object.

bsseq_obj <- readRDS("~/DataDir/1.PreliminaryAnalysis/Output/WithSelectedEGCLCs/bsseq_obj_sharedby75ofall.rds") #getting bsseq object where sample selection and CpG filtering were already performed 

2.2 Annotated DMRs

The DMRs here selected were called with: delta=0.25 and p.threshold=0.0001

DMRs_annotated <- readRDS(params$DMRAnnotated)

2.3 Get imprinted regions collected from different papers

Imprinted regions were taken from the following papers:

Other important references: https://www.geneimprint.com/site/genes-by-species

ImprintedRegions <- readxl::read_xlsx("~/DataDir/5.DMRInterpretation/imprinted_region_all_for_meth.xlsx")
ImprintedRegions_GRanges <- makeGRangesFromDataFrame(ImprintedRegions, seqnames.field = "Chr", start.field = "Start", end.field = "End", keep.extra.columns = TRUE, na.rm=TRUE)

3. Get annoTrack with annotatr and dmrseq

# get annotations for hg38
annoTrack <- dmrseq::getAnnot("hg38")
## Building CpG islands...
## Building CpG shores...
## Building CpG shelves...
## Building inter-CpG-islands...
## Download of CpG annotation successful!
## Loading required package: GenomicFeatures
## Loading required package: AnnotationDbi
## 
## Attaching package: 'AnnotationDbi'
## The following object is masked from 'package:dplyr':
## 
##     select
## 
## 'select()' returned 1:1 mapping between keys and columns
## Building cds...
## Download of Gene annotation successful!

4. Exploration of DMR-associated genes

cellTypes_colors <- c(hiPSCs ="#dd1c77", iMeLCs ="#377eb8", hPGCLCs ="#4daf4a", hEGCLCs = "#ff7f00")
colData(bsseq_obj)$Type <- factor(colData(bsseq_obj)$Type, levels = c("hiPSCs", "iMeLCs" , "hPGCLCs", "hEGCLCs"))

4.1 hPGCLCs vs hiPSCs

4.1.1 Get DMRs hPGCLCs vs hiPSCs

comparison <- "hiPSCsvshPGCLCs"
DMRs <- DMRs_annotated[[comparison]]

4.1.2 Exploration of imprinted genes within hPGCLCs vs hiPSCs DMRs

ImprintedGenes <- ImprintedRegions_GRanges$`Gene locus`
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in ImprintedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: PDE4D, ZFAT, MEG3, RGMA, IGF1R, FAM20A These genes were not found: PPIEL, DIRAS3_Ex2, DIRAS3, GPR1_AS, ZDBF2, MCCC1, NAP1L5, FAM50B, LIN28B, AIM1, PLAGL1_HYMAI, IGF2R_SLC22A2_3, WDR27, GRB10, SGCE_PEG10, MEST, AGBL3, HTR5A, CXORF56_pseudogene_ERLIN2, TRAPPC9, GLIS3, DCAF10, INPP5F, FAM196A_DOCK1, H19, IGF2_DMR2, IGF2_DMR0, KvDMR1, ZC3H12C, N4BP2L1, RB1, IG_DMR, MEG8, MKRN3_MIR4508, MAGEL2, NDN, SNRPN_intragenic_CpG32, SNRPN_intragenic_CpG29, SNRPN_intragenic_CpG30, SNRPN_intragenic_CpG40, SNRPN, SNRPN, SNRPN, SNURF, ZNF597, ZNF597_NAA60, ZNF396, DNMT1, ZNF331, ZNF331, MIR512_1_cluster, PEG3, MCTS2P_HM13, BLCAP_NNAT, L3MBTL, GNAS, NESP_AS_GNAS_AS1, GNAS_XL, GNAS_Ex1A, WRB, NHP2L1, KCNQ1_KCNQ1OT1, KCNQ1_KCNQ1OT1, MEST_MESTIT1, ZIM2_PEG3_MIMT1, DLK1_DIO3

4.1.3 Exploration of irie et al., 2023 relevant genes

SelectedGenes <- c("CDH5", "DMRT1", "PIWIL2", "DAZL")
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in SelectedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: CDH5 These genes were not found: DMRT1, PIWIL2, DAZL

4.2 hPGCLCs vs hEGCLCs

4.2.1 Get DMRs hPGCLCs vs hEGCLCs

comparison <- "hEGCLCsvshPGCLCs"
DMRs <- DMRs_annotated[[comparison]]

4.2.2 Exploration of imprinted genes within hPGCLCs vs hEGCLCs DMRs

ImprintedGenes <- ImprintedRegions_GRanges$`Gene locus`
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in ImprintedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: MCCC1, PDE4D, ZFAT, ZC3H12C, MEG3, RGMA, FAM20A, GNAS These genes were not found: PPIEL, DIRAS3_Ex2, DIRAS3, GPR1_AS, ZDBF2, NAP1L5, FAM50B, LIN28B, AIM1, PLAGL1_HYMAI, IGF2R_SLC22A2_3, WDR27, GRB10, SGCE_PEG10, MEST, AGBL3, HTR5A, CXORF56_pseudogene_ERLIN2, TRAPPC9, GLIS3, DCAF10, INPP5F, FAM196A_DOCK1, H19, IGF2_DMR2, IGF2_DMR0, KvDMR1, N4BP2L1, RB1, IG_DMR, MEG8, MKRN3_MIR4508, MAGEL2, NDN, SNRPN_intragenic_CpG32, SNRPN_intragenic_CpG29, SNRPN_intragenic_CpG30, SNRPN_intragenic_CpG40, SNRPN, SNRPN, SNRPN, SNURF, IGF1R, ZNF597, ZNF597_NAA60, ZNF396, DNMT1, ZNF331, ZNF331, MIR512_1_cluster, PEG3, MCTS2P_HM13, BLCAP_NNAT, L3MBTL, NESP_AS_GNAS_AS1, GNAS_XL, GNAS_Ex1A, WRB, NHP2L1, KCNQ1_KCNQ1OT1, KCNQ1_KCNQ1OT1, MEST_MESTIT1, ZIM2_PEG3_MIMT1, DLK1_DIO3

4.2.3 Exploration of irie et al., 2023 relevant genes

SelectedGenes <- c("CDH5", "DMRT1", "PIWIL2", "DAZL")
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in SelectedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: CDH5, PIWIL2 These genes were not found: DMRT1, DAZL

4.3 hiPSCs vs hEGCLCs

4.3.1 Get DMRs hiPSCs vs hEGCLCs

comparison <- "hEGCLCsvshiPSCs"
DMRs <- DMRs_annotated[[comparison]]

4.3.2 Exploration of Imprinted genes within hiPSCs vs hEGCLCs DMRs

ImprintedGenes <- ImprintedRegions_GRanges$`Gene locus`
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in ImprintedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: MCCC1, GNAS These genes were not found: PPIEL, DIRAS3_Ex2, DIRAS3, GPR1_AS, ZDBF2, NAP1L5, PDE4D, FAM50B, LIN28B, AIM1, PLAGL1_HYMAI, IGF2R_SLC22A2_3, WDR27, GRB10, SGCE_PEG10, MEST, AGBL3, HTR5A, CXORF56_pseudogene_ERLIN2, ZFAT, TRAPPC9, GLIS3, DCAF10, INPP5F, FAM196A_DOCK1, H19, IGF2_DMR2, IGF2_DMR0, KvDMR1, ZC3H12C, N4BP2L1, RB1, IG_DMR, MEG3, MEG8, MKRN3_MIR4508, MAGEL2, NDN, SNRPN_intragenic_CpG32, SNRPN_intragenic_CpG29, SNRPN_intragenic_CpG30, SNRPN_intragenic_CpG40, SNRPN, SNRPN, SNRPN, SNURF, RGMA, IGF1R, ZNF597, ZNF597_NAA60, FAM20A, ZNF396, DNMT1, ZNF331, ZNF331, MIR512_1_cluster, PEG3, MCTS2P_HM13, BLCAP_NNAT, L3MBTL, NESP_AS_GNAS_AS1, GNAS_XL, GNAS_Ex1A, WRB, NHP2L1, KCNQ1_KCNQ1OT1, KCNQ1_KCNQ1OT1, MEST_MESTIT1, ZIM2_PEG3_MIMT1, DLK1_DIO3

4.3.3 Exploration of irie et al., 2023 relevant genes

SelectedGenes <- c("CDH5", "DMRT1", "PIWIL2", "DAZL")
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in SelectedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: PIWIL2 These genes were not found: CDH5, DMRT1, DAZL

4.4 iMeLCs vs hiPSCs

4.4.1 Get DMRs iMeLCs vs hiPSCs

comparison <- "hiPSCsvsiMeLCs"
DMRs <- DMRs_annotated[[comparison]]

4.4.2 Exploration of imprinted genes within iMeLCs vs hiPSCs DMRs

ImprintedGenes <- ImprintedRegions_GRanges$`Gene locus`
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in ImprintedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: These genes were not found: PPIEL, DIRAS3_Ex2, DIRAS3, GPR1_AS, ZDBF2, MCCC1, NAP1L5, PDE4D, FAM50B, LIN28B, AIM1, PLAGL1_HYMAI, IGF2R_SLC22A2_3, WDR27, GRB10, SGCE_PEG10, MEST, AGBL3, HTR5A, CXORF56_pseudogene_ERLIN2, ZFAT, TRAPPC9, GLIS3, DCAF10, INPP5F, FAM196A_DOCK1, H19, IGF2_DMR2, IGF2_DMR0, KvDMR1, ZC3H12C, N4BP2L1, RB1, IG_DMR, MEG3, MEG8, MKRN3_MIR4508, MAGEL2, NDN, SNRPN_intragenic_CpG32, SNRPN_intragenic_CpG29, SNRPN_intragenic_CpG30, SNRPN_intragenic_CpG40, SNRPN, SNRPN, SNRPN, SNURF, RGMA, IGF1R, ZNF597, ZNF597_NAA60, FAM20A, ZNF396, DNMT1, ZNF331, ZNF331, MIR512_1_cluster, PEG3, MCTS2P_HM13, BLCAP_NNAT, L3MBTL, GNAS, NESP_AS_GNAS_AS1, GNAS_XL, GNAS_Ex1A, WRB, NHP2L1, KCNQ1_KCNQ1OT1, KCNQ1_KCNQ1OT1, MEST_MESTIT1, ZIM2_PEG3_MIMT1, DLK1_DIO3

4.4.3 Exploration of irie et al., 2023 relevant genes

SelectedGenes <- c("CDH5", "DMRT1", "PIWIL2", "DAZL")
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in SelectedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: These genes were not found: CDH5, DMRT1, PIWIL2, DAZL

4.5 hPGCLCs vs iMeLCs

4.5.1 Get DMRs hPGCLCs vs iMeLCs

comparison <- "iMeLCsvshPGCLCs"
DMRs <- DMRs_annotated[[comparison]]

4.5.2 Exploration of Imprinted genes within hPGCLCs vs iMeLCs DMRs

ImprintedGenes <- ImprintedRegions_GRanges$`Gene locus`
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in ImprintedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: ZFAT, MEG3, RGMA, FAM20A These genes were not found: PPIEL, DIRAS3_Ex2, DIRAS3, GPR1_AS, ZDBF2, MCCC1, NAP1L5, PDE4D, FAM50B, LIN28B, AIM1, PLAGL1_HYMAI, IGF2R_SLC22A2_3, WDR27, GRB10, SGCE_PEG10, MEST, AGBL3, HTR5A, CXORF56_pseudogene_ERLIN2, TRAPPC9, GLIS3, DCAF10, INPP5F, FAM196A_DOCK1, H19, IGF2_DMR2, IGF2_DMR0, KvDMR1, ZC3H12C, N4BP2L1, RB1, IG_DMR, MEG8, MKRN3_MIR4508, MAGEL2, NDN, SNRPN_intragenic_CpG32, SNRPN_intragenic_CpG29, SNRPN_intragenic_CpG30, SNRPN_intragenic_CpG40, SNRPN, SNRPN, SNRPN, SNURF, IGF1R, ZNF597, ZNF597_NAA60, ZNF396, DNMT1, ZNF331, ZNF331, MIR512_1_cluster, PEG3, MCTS2P_HM13, BLCAP_NNAT, L3MBTL, GNAS, NESP_AS_GNAS_AS1, GNAS_XL, GNAS_Ex1A, WRB, NHP2L1, KCNQ1_KCNQ1OT1, KCNQ1_KCNQ1OT1, MEST_MESTIT1, ZIM2_PEG3_MIMT1, DLK1_DIO3

4.5.3 Exploration of irie et al., 2023 relevant genes

SelectedGenes <- c("CDH5", "DMRT1", "PIWIL2", "DAZL")
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in SelectedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: CDH5 These genes were not found: DMRT1, PIWIL2, DAZL

4.6 iMeLCs vs hEGCLCs

4.6.1 Get DMRs iMeLCs vs hEGCLCs

comparison <- "hEGCLCsvsiMeLCs"
DMRs <- DMRs_annotated[[comparison]]

4.6.2 Exploration of Imprinted genes wthin iMeLCs vs hEGCLCs DMRs

ImprintedGenes <- ImprintedRegions_GRanges$`Gene locus`
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in ImprintedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: MCCC1, GNAS These genes were not found: PPIEL, DIRAS3_Ex2, DIRAS3, GPR1_AS, ZDBF2, NAP1L5, PDE4D, FAM50B, LIN28B, AIM1, PLAGL1_HYMAI, IGF2R_SLC22A2_3, WDR27, GRB10, SGCE_PEG10, MEST, AGBL3, HTR5A, CXORF56_pseudogene_ERLIN2, ZFAT, TRAPPC9, GLIS3, DCAF10, INPP5F, FAM196A_DOCK1, H19, IGF2_DMR2, IGF2_DMR0, KvDMR1, ZC3H12C, N4BP2L1, RB1, IG_DMR, MEG3, MEG8, MKRN3_MIR4508, MAGEL2, NDN, SNRPN_intragenic_CpG32, SNRPN_intragenic_CpG29, SNRPN_intragenic_CpG30, SNRPN_intragenic_CpG40, SNRPN, SNRPN, SNRPN, SNURF, RGMA, IGF1R, ZNF597, ZNF597_NAA60, FAM20A, ZNF396, DNMT1, ZNF331, ZNF331, MIR512_1_cluster, PEG3, MCTS2P_HM13, BLCAP_NNAT, L3MBTL, NESP_AS_GNAS_AS1, GNAS_XL, GNAS_Ex1A, WRB, NHP2L1, KCNQ1_KCNQ1OT1, KCNQ1_KCNQ1OT1, MEST_MESTIT1, ZIM2_PEG3_MIMT1, DLK1_DIO3

4.6.3 Exploration of irie et al., 2023 relevant genes

SelectedGenes <- c("CDH5", "DMRT1", "PIWIL2", "DAZL")
PresentGenes <- vector()
AbsentGenes <- vector()
for(gene_index in SelectedGenes){
  if (any(DMRs$hgnc_symbol %in% gene_index)) {
    PresentGenes <- c(PresentGenes, gene_index)
    plotDMRs(bsseq_obj, regions=DMRs[DMRs$hgnc_symbol %in% gene_index,], testCovariate=3, annoTrack=annoTrack, qval = FALSE, stat = FALSE, extend = 5000, main = paste0(gene_index," - ", DMRs[DMRs$hgnc_symbol %in% gene_index,]$ChipSeekerAnn), verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
  } else{ 
    AbsentGenes <- c(AbsentGenes, gene_index)
    next}
}

These genes were found: PIWIL2 These genes were not found: CDH5, DMRT1, DAZL

5. Imprinted regions in the bsseq object

for (region in 1:length(ImprintedRegions_GRanges)) {
    tryCatch({
      plotDMRs(bsseq_obj, regions=ImprintedRegions_GRanges[region,], testCovariate=3, annoTrack=annoTrack, main = paste0("Gene locus: ", ImprintedRegions_GRanges[region,]$`Gene locus`), qval = FALSE, stat = FALSE, extend = 5000, verbose = FALSE, horizLegend = TRUE, col = c(rep(cellTypes_colors[1:2], each = 4), rep(cellTypes_colors[3:4], each = 3)))
      }, error=function(e){})
}

6. Date and Session Info

date()
## [1] "Mon Jan 13 11:40:49 2025"
sessionInfo()
## R version 4.2.1 (2022-06-23)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] org.Hs.eg.db_3.16.0                     
##  [2] TxDb.Hsapiens.UCSC.hg38.knownGene_3.16.0
##  [3] GenomicFeatures_1.50.4                  
##  [4] AnnotationDbi_1.60.2                    
##  [5] sechm_1.6.0                             
##  [6] annotatr_1.24.0                         
##  [7] dmrseq_1.18.1                           
##  [8] bsseq_1.34.0                            
##  [9] SummarizedExperiment_1.28.0             
## [10] Biobase_2.58.0                          
## [11] MatrixGenerics_1.10.0                   
## [12] matrixStats_1.0.0                       
## [13] GenomicRanges_1.50.2                    
## [14] GenomeInfoDb_1.34.9                     
## [15] IRanges_2.32.0                          
## [16] S4Vectors_0.36.2                        
## [17] BiocGenerics_0.44.0                     
## [18] dplyr_1.1.2                             
## [19] gridExtra_2.3                           
## [20] scales_1.2.1                            
## [21] ggplot2_3.4.2                           
## 
## loaded via a namespace (and not attached):
##   [1] readxl_1.4.3                  circlize_0.4.15              
##   [3] AnnotationHub_3.6.0           BiocFileCache_2.6.1          
##   [5] plyr_1.8.8                    splines_4.2.1                
##   [7] BiocParallel_1.32.6           digest_0.6.33                
##   [9] ca_0.71.1                     foreach_1.5.2                
##  [11] htmltools_0.5.5               fansi_1.0.4                  
##  [13] magrittr_2.0.3                memoise_2.0.1                
##  [15] BSgenome_1.66.3               cluster_2.1.4                
##  [17] doParallel_1.0.17             tzdb_0.4.0                   
##  [19] limma_3.54.2                  ComplexHeatmap_2.14.0        
##  [21] Biostrings_2.66.0             readr_2.1.4                  
##  [23] vroom_1.6.3                   R.utils_2.12.2               
##  [25] prettyunits_1.1.1             colorspace_2.1-0             
##  [27] blob_1.2.4                    rappdirs_0.3.3               
##  [29] xfun_0.39                     crayon_1.5.2                 
##  [31] RCurl_1.98-1.12               jsonlite_1.8.7               
##  [33] iterators_1.0.14              glue_1.6.2                   
##  [35] registry_0.5-1                gtable_0.3.3                 
##  [37] zlibbioc_1.44.0               XVector_0.38.0               
##  [39] V8_4.3.0                      GetoptLong_1.0.5             
##  [41] DelayedArray_0.24.0           Rhdf5lib_1.20.0              
##  [43] shape_1.4.6                   HDF5Array_1.26.0             
##  [45] DBI_1.1.3                     rngtools_1.5.2               
##  [47] randomcoloR_1.1.0.1           Rcpp_1.0.11                  
##  [49] xtable_1.8-4                  progress_1.2.2               
##  [51] clue_0.3-64                   bumphunter_1.40.0            
##  [53] bit_4.0.5                     httr_1.4.6                   
##  [55] RColorBrewer_1.1-3            ellipsis_0.3.2               
##  [57] pkgconfig_2.0.3               XML_3.99-0.14                
##  [59] R.methodsS3_1.8.2             sass_0.4.7                   
##  [61] dbplyr_2.3.3                  locfit_1.5-9.7               
##  [63] utf8_1.2.3                    tidyselect_1.2.0             
##  [65] rlang_1.1.1                   reshape2_1.4.4               
##  [67] later_1.3.1                   cellranger_1.1.0             
##  [69] munsell_0.5.0                 BiocVersion_3.16.0           
##  [71] tools_4.2.1                   cachem_1.0.8                 
##  [73] cli_3.6.1                     generics_0.1.3               
##  [75] RSQLite_2.3.1                 evaluate_0.21                
##  [77] stringr_1.5.0                 fastmap_1.1.1                
##  [79] yaml_2.3.7                    outliers_0.15                
##  [81] knitr_1.43                    bit64_4.0.5                  
##  [83] KEGGREST_1.38.0               nlme_3.1-162                 
##  [85] doRNG_1.8.6                   sparseMatrixStats_1.10.0     
##  [87] mime_0.12                     R.oo_1.25.0                  
##  [89] xml2_1.3.5                    biomaRt_2.54.1               
##  [91] compiler_4.2.1                rstudioapi_0.15.0            
##  [93] filelock_1.0.2                curl_5.0.1                   
##  [95] png_0.1-8                     interactiveDisplayBase_1.36.0
##  [97] tibble_3.2.1                  bslib_0.5.0                  
##  [99] stringi_1.7.12                highr_0.10                   
## [101] lattice_0.21-8                Matrix_1.6-0                 
## [103] permute_0.9-7                 vctrs_0.6.3                  
## [105] pillar_1.9.0                  lifecycle_1.0.3              
## [107] rhdf5filters_1.10.1           BiocManager_1.30.20          
## [109] GlobalOptions_0.1.2           jquerylib_0.1.4              
## [111] data.table_1.14.8             bitops_1.0-7                 
## [113] seriation_1.4.2               httpuv_1.6.11                
## [115] rtracklayer_1.58.0            R6_2.5.1                     
## [117] BiocIO_1.8.0                  TSP_1.2-4                    
## [119] promises_1.2.0.1              codetools_0.2-19             
## [121] gtools_3.9.4                  rhdf5_2.42.1                 
## [123] rjson_0.2.21                  withr_2.5.0                  
## [125] regioneR_1.30.0               GenomicAlignments_1.34.1     
## [127] Rsamtools_2.14.0              GenomeInfoDbData_1.2.9       
## [129] parallel_4.2.1                hms_1.1.3                    
## [131] grid_4.2.1                    rmarkdown_2.23               
## [133] DelayedMatrixStats_1.20.0     Rtsne_0.16                   
## [135] shiny_1.7.4.1                 restfulr_0.0.15