CpGsInfoOneRegion: Test associations of individual CpGs in a genomic region with...

Description Usage Arguments Details Value Examples

View source: R/CpGsInfoOneRegion.R

Description

Test associations of individual CpGs in a genomic region with a continuous phenotype

Usage

1
2
3
4
5
6
7
8
CpGsInfoOneRegion(
  regionName_char,
  betas_df,
  pheno_df,
  contPheno_char,
  covariates_char,
  arrayType = c("450k", "EPIC")
)

Arguments

regionName_char

character string of location information for a genomic region, specified in the format of "chrxx:xxxxxx-xxxxxx"

betas_df

data frame of beta values with row names = CpG IDs, column names = sample IDs

pheno_df

a data frame with phenotype and covariate variables, with variable "Sample" for sample IDs.

contPheno_char

character string of the continuous phenotype, to be tested against methylation values

covariates_char

character vector of covariate variables names

arrayType

Type of array, can be "450k" or "EPIC"

Details

This function implements linear models that test association between methylation values in a genomic region with a continuous phenotype. Note that methylation M values are used as regression outcomes in these models. The model for each CpG is:

methylation M value ~ contPheno_char + covariates_char

Value

a data frame with location of the genomic region (Region), CpG ID (cpg), chromosome (chr), position (pos), results for testing association of methylation in individual CpGs with continuous phenotype (slopeEstimate, slopePval) and annotations for the regions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
   data(betasChr22_df)
   data(pheno_df)

   CpGsInfoOneRegion(
     regionName_char = "chr22:19709548-19709755",
     betas_df = betasChr22_df,
     pheno_df, contPheno_char = "stage",
     covariates_char = c("age.brain", "sex"),
     arrayType = "450k"
   )

   # not adjusting for covariates
   CpGsInfoOneRegion(
     regionName_char = "chr22:18267969-18268249",
     betas_df = betasChr22_df,
     pheno_df, contPheno_char = "stage",
     covariates_char = NULL
   )

lissettegomez/coMethDMR documentation built on April 25, 2021, 1:10 p.m.