Skip to content

Better contrasts#66

Open
ianbed wants to merge 8 commits into
masterfrom
betterContrasts
Open

Better contrasts#66
ianbed wants to merge 8 commits into
masterfrom
betterContrasts

Conversation

@ianbed

@ianbed ianbed commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Made changes to Snakefile, resources/deseq_template.Rmd, workflow/rules/deseq2.smk, and units.tsv template.
Together these changes allow for easier building of contrasts including covariates (i.e. group_reg_formula can now be '~group + batch' or '~treatment + batch' etc.) and removal of 'group' as the key variable; 'group' can still be the variable tested, but now the variable is extracted from group_reg_formula (the first string following ~). This is passed dynamically to deseq2 and elsewhere where group was formerly hardcoded.
I have also added the ability to filter samples based on columnFilter==columnFilterLevel. This can be useful for subsetting which samples should be contrasted. For example, suppose you have 2 samples that are outliers and need to be removed. Add a 'filter' column in units.tsv and set it to TRUE for these two samples. Then in comparisons.tsv set columnFilter to 'filter' and columnFilterValue to '' and these two samples will be removed prior to DE analysis.

ianbed and others added 5 commits June 30, 2026 13:12
…olumn of interest is extracted from the group_reg_formula and the levels of group_test and group_reference are tested against this
…ts. Two main new things. First, units.tsv now has 2 additional optional columns columnFilter and columnFilterLevel. These will filter to samples where columnFilter==columnFilterLevel; this is to allow e.g. a treatment contrast within a subset of samples. Second, 'group' was hard coded as the column to contrast; this has been replaced by extracting the first variable in the group_reg_formula (which actually is a misnomer now but left unchanged). If the group_reg_formula is '~treatment + batch' the values or group_test and group_reference are now expected to be found in the treatment column. This is similar to the checks done is the Snakefile in python.
dfbautista and others added 3 commits June 30, 2026 17:24
avoids issue with TRUE getting evaluated as a logical 'True' by python and passed to deseq_template.Rmd as 'True' in params when should be TRUE.
Added check to ensure that comparison names are not duplicated; if du…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants