Logic_regression: Logistical regression analysis for each region or each...

View source: R/DMR_test.R

Logic_regressionR Documentation

Logistical regression analysis for each region or each cytosine site.

Description

This function tests each region or each cytosine site by logistical regression model to achieve the P values and then be adjusted to Q values to account for multiple hypothesis testing.

Usage

Logic_regression(
  genefeatureall_cpgfeature,
  covariates = NULL,
  adjustedmethod = "fdr",
  diffgroup = NULL
)

Arguments

genefeatureall_cpgfeature

refers to the input file with methylation levels to be tested.

covariates

refers to the extra covariates used in the model, with the default NULL.

adjustedmethod

refers to the methods to adjust P values to Q values, with the default "fdr" method. The adjustedmethod could be "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "none" methods as well.

diffgroup

refers to methylation difference between two groups, with the default NULL, that is the max group - min group. The two groups can be manually selected e.g., diffgroup = c("group1", "group2").

Value

Outputs a data frame of region gene or region cpgi or those regions with different features or cytosine sites, by accompanying with P values, Q values and methylation differences.

Examples

regiongeneall_Qvalue <- Logic_regression(regiongeneall)
regiongenealls_Qvalue <- Logic_regression(regiongenealls)
regioncpgall_Qvalue <- Logic_regression(regioncpgall , adjustedmethod = "fdr")
regiongenebodyall_Qvalue <- Logic_regression(regiongenebodyall, diffgroup = c("group1", "group2"))
regiongeneall_cpgfeature_Qvalue <- Logic_regression(regiongeneall_cpgfeature)
genefeatureall_cpgfeature_Qvalue <- Logic_regression(genefeatureall_cpgfeature)
genefeatureall_Qvalue <- Logic_regression(genefeatureall, adjustedmethod = "bonferroni")

siteall_Qvalue <- Logic_regression(siteall, adjustedmethod = "fdr") # for each cytosine site #
siteall_Qvalue <- Logic_regression(siteall, adjustedmethod = "fdr", diffgroup = c("group1", "group2"))

covariateinfo <- data.frame(Timepoint = c("week3","week3","week12","week12","week12"), Diet = c("Low","High","Low","High","High")) # for environmental factors #
regiongeneall_Qvalue <- Logic_regression(regiongeneall, covariates = covariateinfo)


xiaowangCN/GeneDMRs documentation built on Nov. 22, 2023, 11:19 p.m.