sccomp_remove_unwanted_variation: sccomp_remove_unwanted_variation

sccomp_remove_unwanted_variationR Documentation

sccomp_remove_unwanted_variation

Description

This function uses the model to remove unwanted variation from a dataset using the estimated of the model. For example if you fit your data with this formula ~ factor_1 + factor_2 and use this formula to remove unwanted variation ~ factor_1, the factor_2 will be factored out.

Usage

sccomp_remove_unwanted_variation(
  .data,
  formula_composition = ~1,
  formula_variability = NULL
)

Arguments

.data

A tibble. The result of sccomp_estimate.

formula_composition

A formula. The formula describing the model for differential abundance, for example ~treatment. This formula can be a sub-formula of your estimated model; in this case all other factor will be factored out.

formula_variability

A formula. The formula describing the model for differential variability, for example ~treatment. In most cases, if differentially variability is of interest, the formula should only include the factor of interest as a large anount of data is needed to define variability depending to each factors. This formula can be a sub-formula of your estimated model; in this case all other factor will be factored out.

Value

A nested tibble tbl with cell_group-wise statistics

Examples


data("counts_obj")

  estimates = sccomp_estimate(
  counts_obj ,
   ~ type, ~1,  sample, cell_group, count,
    cores = 1
  )

  sccomp_remove_unwanted_variation(estimates)


stemangiola/sccomp documentation built on May 17, 2024, 6:24 a.m.