Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contrast specification #377

Open
grst opened this issue Dec 6, 2024 · 0 comments
Open

Contrast specification #377

grst opened this issue Dec 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@grst
Copy link
Member

grst commented Dec 6, 2024

Description of feature

In #362 we suggested to support more complex models and contrasts. This issue is to explore and find a consens on how to define contrasts for a given model.

Types of contrasts

While trying to be as consistent as possible between methods, different methods support different tests and might require different contrast definitions. I envisage we have a set of contrast types and each method can support one or multiple contrast types. Below I provide an overview
of the suggested contrast types and how I envisage they could be specified in yaml format.

We don't need to support all of them initially, but we should design the pipeline in a way it can be easily extended to more contrast types in the future.

Complex contrasts based on coefficients

Most linear-model based methods should support definition of contrasts based on comparison of linear model coefficients. There are different mini "domain specific languages" (DSL) to specify contrasts based on variable names that all ultimately resolve into a numeric contrast vector that aligns
with the linear model design matrix. Choosing the right one is a topic for itself, so I'll open a separate issue. Still, I'd imagine the contrast definition
to look somewhat like

contrasts:
 - id: interaction_treatment_response
   type: complex # or `makeContrasts`, `cond`, ... depending on the method used to build contrasts (??)
   comparison: (treatmentA_responders - treatmentA_nonresponders) - (treatmentB_responders - treatmentB_nonresponders)

--> See #386 for complex contrasts specification

Simple pairwise comparison

This is a special case of the complex contrasts. It is mostly for convenience (one doesn't need to understand design matrices to define a "simple" contrast). Also there could be methods added that do not support complex contrasts.

contrasts:
 - id: a_vs_b
   type: pairwise # or 'simple' ? 
   comparison: ["treatment", "A", "B"] # variable, baseline, target

or alternatively a bit more verbose

 contrasts:
 - id: a_vs_b
   variable: treatment
   baseline: A
   target: B

Full and reduced model

DESeq2 implements a liklihood ratio test (LRT) where two models are compared to each other.

contrasts:
 - id: check_treatment_effect
   type: full_vs_reduced
   full: "~treatment + response"
   reduced: "~ response"

ANOVA

ANOVA is a special case of the liklihood ratio test. Supported by propd (see #362 (comment)) and by DESeq2 via LRT.

contrasts:
 - id: check_treatment_effect
   type: anova
   variable: treatment

CC @apeltzer @tschwarzl @atrigila @alanmmobbs93 @nschcolnicov @suzannejin

@grst grst added the enhancement New feature or request label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant