Function `calculate_test`

computes log folds and p-values for choosen test for data from methylation or expression.
The function uses: t-test, negative binomial test, likelihood-ratio test(LRT), quasi-likelihood F-test(QLF).
By default function calls the `t-test`

.

calculate_test(data, condition, test = "ttest", ...)

data | An object of the class appropriate for the given test. More in |
---|---|

condition | Factor of levels coresponding to order of samples in data. |

test | Variable defining test. Values: ttest, nbinom, nbinom2, lrt, qlf, methyanalysis. More in |

... | Other parameters e.g. `adjust.method` for argument `ttest`. |

A data frame with the following columns:

The id of the observable, taken from the row names of the counts slots.

The log2 of the fold change.

The p-values for rejecting the null hypothesis about the means equality.

Column correspond to means for each gene defined by condition and mean for all probes.

Each test may require different data. In this section we will describe details for each availible test:

- ttest
Student's t-test

Test for expression and methylation.

This test is based on function`lmFit`

from`limma`

package.

For this test you should aggregate CpG probes to genes using function:`aggregate_probes`

. Data for this test should have following structure: columns correspond to genes, rows to samples.- nbinom
Negative binomial test

Test for expression.

This test is based on function`nbinomTest`

from`DESeq`

package.

Data for this test should have following structure: columns correspond to genes, rows to samples.

Calculations may take some time. It is suggested to use`nbinom2`

parameter.- nbinom2
Negative binomial test

Test for expression.

This test is based on function`DESeq`

from`DESeq2`

package.

Data for this test should have following structure: columns correspond to genes, rows to samples.- lrt
Likelihood-ratio test (LRT)

Test for expression.

This test is based on function`glmFit`

and`glmLRT`

from`edgeR`

package.

Data for this test should have following structure: columns correspond to genes, rows to samples.- qlf
Quasi-likelihood F-test (QLF)

Test for expression.

This test is based on functions`glmQLFit`

and`glmQLFTest`

from`edgeR`

package.

Data for this test should have following structure: columns correspond to genes, rows to samples.- methyanalysis
Slide window smoothing

Test for methylation.

This test is based on function`detectDMR.slideWin`

from`methyAnalysis`

package. It requires a special class of argument data -`MethyGenoSet`

.

# NOT RUN { library(MLExpRessoData) BRCA_methylation_gene <- aggregate_probes(BRCA_methylation_all) condition_m <- ifelse(BRCA_methylation_all$SUBTYPE == "LumA", "LumA", "other") test_methylation <- calculate_test(BRCA_methylation_gene, condition_m, "ttest") # }