Better contrasts#66
Open
ianbed wants to merge 8 commits into
Open
Conversation
…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.
syncing betterContrasts
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…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.