View source: R/diff_dss_test.R
diff_dss_test | R Documentation |
This function is a wrapper for DSS::DMLtest.multiFactor
with the added feature of reporting methylation rates alongside the test results via the methylation_group_column
and methylation_groups
parameters. See documentation below.
diff_dss_test(
bs,
diff_fit,
contrast,
methylation_group_column = NA,
methylation_groups = NA
)
bs |
a |
diff_fit |
a |
contrast |
a contrast matrix for hypothesis testing. The number of rows should match the number of columns |
methylation_group_column |
Optionally, a column from |
methylation_groups |
Optionally, a named |
A GRanges
object containing the following mcols
:
The test statistic.
The p-value.
The Benjamini-Hochberg adjusted p-values using p.adjust(method = 'BH')
.
If methylation_group_column
is specified, also the following mcols
:
Methylation estimate for case.
Methylation estimate for control.
The difference meth_case - meth_control
.
The group for which the locus is hyper-methylated. Note, this is not subject to significance thresholds.
data(BS.cancer.ex, package = 'bsseqData')
bs = filter_loci_by_group_coverage(
bs = BS.cancer.ex,
group_column = 'Type',
c('cancer' = 2, 'normal' = 2))
small_test = bs[1:50]
diff_fit = diff_dss_fit(
bs = small_test,
design = bsseq::pData(bs),
formula = '~ Type')
result = diff_dss_test(
bs = small_test,
diff_fit = diff_fit,
contrast = matrix(c(0,1), ncol = 1)
)
result_with_meth = diff_dss_test(
bs = small_test,
diff_fit = diff_fit,
contrast = matrix(c(0,1), ncol = 1),
methylation_group_column = 'Type',
methylation_groups = c('case' = 'cancer', 'control' = 'normal')
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.