scmet_differential: Differential testing using scMET

View source: R/scmet_differential.R

scmet_differentialR Documentation

Differential testing using scMET

Description

Function for performing differential methylation testing to identify differentially methylted (DM) and differentially variable (DV) features across two groups of pre-specified cell populations.

Usage

scmet_differential(
  obj_A,
  obj_B,
  psi_m = log(1.5),
  psi_e = log(1.5),
  psi_g = log(1.5),
  evidence_thresh_m = 0.8,
  evidence_thresh_e = 0.8,
  evidence_thresh_g = 0.8,
  efdr_m = 0.05,
  efdr_e = 0.05,
  efdr_g = 0.05,
  group_label_A = "GroupA",
  group_label_B = "GroupB",
  features_selected = NULL,
  filter_outlier_features = FALSE,
  outlier_m = 0.05,
  outlier_g = 0.05
)

Arguments

obj_A

The scMET posterior object for group A.

obj_B

The scMET posterior object for group B.

psi_m

Minimum log odds ratio tolerance threshold for detecting changes in overall methylation (positive real number). Default value: psi_m = log(1.5) (i.e. 50% increase).

psi_e

Minimum log odds ratio tolerance threshold for detecting changes in residual over-dispersion (positive real number).

psi_g

Minimum log odds ratio tolerance threshold for detecting changes in biological over-dispersion (positive real number).

evidence_thresh_m

Optional parameter. Posterior evidence probability threshold parameter ⁠alpha_{M}⁠ for detecting changes in overall methylation (between 0.6 and 1). If efdr_m = NULL, then threshold will be set to evidence_thresh_m. If a value for EFDR_M is provided, the posterior probability threshold is chosen to achieve an EFDR equal to efdr_m and evidence_thresh_m defines a minimum probability threshold for this calibration (this avoids low values of evidence_thresh_m to be chosen by the EFDR calibration. Default value evidence_thresh_m = 0.8.

evidence_thresh_e

Optional parameter. Posterior evidence probability threshold parameter ⁠alpha_{G}⁠ for detecting changes in cell-to-cell residual over-dispersion. Same usage as above.

evidence_thresh_g

Optional parameter. Posterior evidence probability threshold parameter ⁠alpha_{G}⁠ for detecting changes in cell-to-cell biological over-dispersion. Same usage as above.

efdr_m

Target for expected false discovery rate related to the comparison of means. If efdr_m = NULL, no calibration is performed, and ⁠alpha_{M}⁠ is set to evidence_thresh_m. Default value: efdr_m = 0.05.

efdr_e

Target for expected false discovery rate related to the comparison of residual over-dispersions If efdr_e = NULL, no calibration is performed, and 'alpha_E“ is set to evidence_thresh_e. Default value: efdr_e = 0.05.

efdr_g

Target for expected false discovery rate related to the comparison of biological over-dispersions If efdr_g = NULL, no calibration is performed, and ⁠alpha_{G}⁠ is set to evidence_thresh_g. Default value: efdr_g = 0.05.

group_label_A

Label assigned to group A.

group_label_B

Label assigned to group B.

features_selected

User defined list of selected features to perform differential analysis. Should be the same length as the total number of features, with TRUE for features included in the differential analysis, and FALSE for those excluded from further analysis.

filter_outlier_features

Logical, whether to filter features that have either mean methylation levels mu or overdispersion gamma across both groups near the range edges, i.e. taking values near 0 or 1. This mostly is an issue due to taking the logit transformation which effectively makes small changes in actual space (0, 1) to look really large in transformed space (-Inf, Inf). In general we expect this will not remove many interesting features with biological information.

outlier_m

Value of average mean methylation across both groups so a feature is considered as outlier. I.e. if set to 0.05, then will remove features with mu < 0.05 or mu > 1 - 0.05. Only used if filter_outlier_features = TRUE.

outlier_g

Value of average overdispersion gamma across groups so a feature is considered as outlier. Same as outlier_m parameter above.

Value

An scmet_differential object which is a list containing the following elements:

  • diff_mu_summary: A data.frame containing differential mean methylation output information per feature (rows), including posterior median parameters for each group and mu_LOR containing the log odds-ratio between the groups. The mu_tail_prob column contains the posterior tail probability of a feature being called as DM. The mu_diff_test column informs the outcomes of the test.

  • diff_epsilon_summary: Same as above, but for differential variability based on residual overdispersion.

  • diff_gamma_summary: The same as above but for DV analysis based on overdispersion.

  • diff_mu_thresh: Information about optimal posterior evidence threshold search for mean methylation mu.

  • diff_epsilon_thresh: Same as above but for residual overdispersion epsilon..

  • diff_gamma_thresh: Same as above but for overdispersion gamma.

  • opts: The parameters used for testing. For reproducibility purposes.

Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

See Also

scmet, scmet_hvf_lvf

Examples

## Not run: 
# Fit scMET for each group
fit_A <- scmet(Y = scmet_diff_dt$scmet_dt_A$Y,
X = scmet_diff_dt$scmet_dt_A$X, L = 4, iter = 50, seed = 12)
fit_B <- scmet(Y = scmet_diff_dt$scmet_dt_B$Y,
X = scmet_diff_dt$scmet_dt_B$X, L = 4, iter = 50, seed = 12)

# Run differential test
diff_obj <- scmet_differential(obj_A = fit_A, obj_B = fit_B)

## End(Not run)


andreaskapou/scMET documentation built on Feb. 1, 2024, 10:46 a.m.