convoluted_glm: convoluted_glm main

View source: R/methods.R

convoluted_glmR Documentation

convoluted_glm main

Description

The function for convoluted linear modelling takes as input a tidy table of feature count with three columns containing a sample ID, transcript ID and count, formula (continuous or discrete) and the covariate columns. The user can define a linear model with an input R formula, where the first covariate is the factor of interest.

Usage

convoluted_glm(
  .data,
  .formula = ~1,
  .sample,
  .transcript,
  .abundance,
  reference = NULL,
  tree = NULL,
  approximate_posterior = F,
  prior_survival_time = c(),
  transform_time_function = sqrt,
  use_data = TRUE,
  use_cmdstanr = FALSE
)

Arguments

.data

A tibble including a cell_group name column | sample name column | read counts column (optional depending on the input class) | covariate columns.

.sample

A column name as symbol. The sample identifier

.transcript

A column name as symbol. The cell_group identifier

.abundance

A column name as symbol. The cell_group abundance (read count). Used only for data frame count output. The variable in this column should be of class integer.

reference

A data frame

tree

A node object

approximate_posterior

A boolean

prior_survival_time

A list

transform_time_function

A function with nake survival time normally-shaped.

formula

A formula. The formula describing the model for differential abundance, for example ~treatment.

Value

A nested tibble 'tbl', with the following columns

  • cell_group - column including the cell groups being tested

  • parameter - The parameter being estimated, from the design matrix dscribed with the input formula_composition and formula_variability

  • c_lower - lower (2.5

  • c_effect - mean of the posterior distribution for a composition (c) parameter.

  • c_upper - upper (97.5

  • c_pH0 - Probability of the null hypothesis (no difference) for a composition (c). This is not a p-value.

  • c_FDR - False-discovery rate of the null hypothesis (no difference) for a composition (c).

  • v_lower - (optional, present if variability is modelled dependent on covariates) lower (2.5

  • v_effect - (optional, present if variability is modelled dependent on covariates) mean of the posterior distribution for a variability (v) parameter

  • v_upper - (optional, present if variability is modelled dependent on covariates) upper (97.5

  • v_pH0 - (optional, present if variability is modelled dependent on covariates) Probability of the null hypothesis (no difference) for a variability (v). This is not a p-value.

  • v_FDR - (optional, present if variability is modelled dependent on covariates) False-discovery rate of the null hypothesis (no difference), for a variability (v).

Examples


data("test_mixture")
data("no_hierarchy_reference")

 test_mixture |>
 convoluted_glm(
   ~ factor_of_interest,
   .sample = sample,
   .transcript = symbol,
   .abundance = count,
   reference = no_hierarchy_reference
  )


stemangiola/ARMET documentation built on July 9, 2022, 1:25 a.m.