### Install methylclock and methylclockData Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Installs the required BiocManager, methylclock, and methylclockData packages. Ensure BiocManager is installed first. ```R if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install(c("methylclock", "methylclockData")) ``` -------------------------------- ### Load Test Dataset for Development Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Load the included test dataset for validating methylclock package functionality. This includes methylation data examples and probe annotation for the 21K array. ```r library(ExperimentHub) eh <- ExperimentHub() pData <- query(eh, "methylclockData") # Download test dataset test_data <- pData[["EH3928"]] # TestDataset.rda # Inspect test data structure str(test_data) # Download methylation data example meth_example <- pData[["EH3926"]] # MethylationDataExample55.rda head(meth_example) # Download probe annotation for 21K array probe_annot <- pData[["EH3927"]] # probeAnnotation21kdatMethUsed.rda head(probe_annot) ``` -------------------------------- ### Load Libraries Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Loads the methylclock and ExperimentHub libraries for use in your R session. ```R library(methylclock) library(ExperimentHub) ``` -------------------------------- ### Load ExperimentHub Data Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Load ExperimentHub records and query for 'methylclockData' datasets. View metadata and preview specific datasets by ID. Download datasets to local memory for inspection. ```r library(ExperimentHub) # Get ExperimentHub records eh <- ExperimentHub() # Query for methylclockData datasets pData <- query(eh, "methylclockData") # View metadata about available datasets df <- mcols(pData) print(df) # Preview a specific dataset by ID pData["EH3913"] # Download the dataset to local memory data <- pData[["EH3913"]] # Inspect the downloaded data structure str(data) ``` -------------------------------- ### Load Methylation Clock Coefficients Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Retrieve coefficient data for various methylation clocks, including chronological, gestational, and biological age clocks. Use ExperimentHub IDs to load specific coefficient datasets. ```r library(ExperimentHub) eh <- ExperimentHub() pData <- query(eh, "methylclockData") # List all available datasets with their ExperimentHub IDs mcols(pData)[, c("title", "rdatapath")] # Chronological DNAm age clocks (age in years): # - coefHorvath.rda: 353 CpGs (Horvath 2013) - multi-tissue # - coefHannum.rda: 71 CpGs (Hannum 2013) - blood samples # - coefSkin.rda: 391 CpGs (Horvath 2018) - skin+blood # - coefPedBE.rda: 84 CpGs (McEwen 2019) - buccal epithelial, ages 0-20 # - coefWu.rda: 111 CpGs (Wu 2019) - children # Gestational DNAm age clocks (age in weeks): # - coefKnightGA.rda: 148 CpGs (Knight 2016) - cord blood # - coefBohlin.rda: 96 CpGs (Bohlin 2016) - cord blood # - coefMayneGA.rda: 62 CpGs (Mayne 2017) # - coefLeeGA.rda: RPC (558 CpGs), CPC (546 CpGs), Refined RPC (396 CpGs) # Biological DNAm clocks: # - coefLevine.rda: 513 CpGs PhenoAge (Levine 2018) # - coefTL.rda: 140 CpGs Telomere Length (Lu 2019) # Example: Load Horvath clock coefficients cof_horvath <- pData[["EH3915"]] # coefHorvath.rda head(coef_horvath) ``` -------------------------------- ### Access BNN Clock CpG Data Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Load the CpG sites used for training the Bayesian Neural Network (BNN) clock, which is utilized for DNAm age prediction. This provides the identifiers for the CpGs involved in BNN training. ```r library(ExperimentHub) eh <- ExperimentHub() pData <- query(eh, "methylclockData") # Load CpGs for BNN clock (Horvath's CpGs) cpgs_bnn <- pData[["EH3914"]] # cpgs.bn.rda # View the CpG identifiers used in BNN training print(cpgs_bnn) length(cpgs_bnn) ``` -------------------------------- ### Access Cell Count Reference Datasets Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Load predefined reference methylation profiles for cell count estimation, essential for calculating Extrinsic Epigenetic Age Acceleration (EEAA). Available references include data from various studies and cell types. ```r library(ExperimentHub) eh <- ExperimentHub() pData <- query(eh, "methylclockData") # Download methylclock references (cell type profiles) references <- pData[["EH3913"]] # Available reference datasets: # - "blood gse35069 complete": CD4T, CD8T, Mono (Reinius et al.) # - "blood gse35069": CD4T, CD8T, Mono, Bcell, NK, Gran # - "blood gse35069 chen": CD4T, CD8T, Mono, Bcell, NK, Neu, Eos # - "andrews and bakulski cord blood": Bcell, CD4T, CD8T, Gran, Mono, NK, nRBC # - "cord blood gse68456": CD4T, CD8T, Mono, Bcell, NK, Neu, Eos, RBC # - "gervin and lyle cord blood": CD14, Bcell, CD4T, CD8T, NK, Gran # - "saliva gse48472": Buccal, CD4T, CD8T, Mono, Bcell, NK, Gran # Access a specific reference blood_ref <- references[["blood gse35069"]] str(blood_ref) ``` -------------------------------- ### Access Specific Clock Results Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Retrieves specific epigenetic age estimations (e.g., Horvath, Hannum, Levine/PhenoAge) from the DNAmAge results object. ```R horvath_age <- result$Horvath hannum_age <- result$Hannum phenoage <- result$Levine ``` -------------------------------- ### Estimate Gestational Age Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Estimates gestational age using DNA methylation beta values from cord blood samples. ```R ga_result <- DNAmGA(cord_blood_betas) ``` -------------------------------- ### Access Specific Gestational Age Results Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Retrieves specific gestational age estimations (e.g., Knight, Bohlin) from the DNAmGA results object. ```R knight_ga <- ga_result$Knight bohlin_ga <- ga_result$Bohlin ``` -------------------------------- ### Estimate DNAm Age Source: https://context7.com/isglobal-brge/methylclockdata/llms.txt Estimates epigenetic age using DNA methylation beta values. Requires sample ages and optionally estimates cell counts and normalizes data. ```R result <- DNAmAge(beta_values, age = sample_ages, # chronological ages cell.count = TRUE, # estimate cell counts normalize = TRUE) # normalize data ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.