get_dmp

pylluminator.dm.get_dmp(samples: Samples, formula: str, reference_value: dict | None = None, custom_sheet: None | DataFrame = None, drop_na=False, apply_mask=True, probe_ids: None | list[str] = None, group_column: str | None = None)

Find Differentially Methylated Probes (DMP) by fitting an Ordinary Least Square model (OLS) for each probe, following the given formula. If a group column name is given, use a Mixed Model to account for random effects.

More info on design matrices and formulas:
Parameters:
  • samples (Samples) – samples to use

  • formula (str) – R-like formula used in the design matrix to describe the statistical model. e.g. ‘~age + sex’

  • reference_value (dict | None) – reference value for each factor. Default: None

  • custom_sheet (pandas.DataFrame) – a sample sheet to use. By default, use the samples’ sheet. Useful if you want to filter the samples to display

  • drop_na (bool) – drop probes that have NA values. Default: False

  • apply_mask (bool) – set to True to apply mask. Default: True

  • probe_ids (list[str] | None) – list of probe IDs to use. Useful to work on a subset for testing purposes. Default: None

  • group_column (str | None) – name of the column of the sample sheet that holds replicates information. If provided, a Mixed Model will be used to account for replicates instead of an Ordinary Least Square. Default: None

Returns:

dataframe with probes as rows and p_vales and model estimates in columns, list of contrast levels

Return type:

pandas.DataFrame, list[str]