frattalab / PAPA

PAPA (Pipeline-Alternative Polyadenylation) - Snakemake pipeline for analysis of APA from short-read RNA-seq data
GNU General Public License v3.0
1 stars 0 forks source link

NameError - name 'CONTRAST_NAME' is not defined if run_differential set to False #48

Open SamBryce-Smith opened 1 year ago

SamBryce-Smith commented 1 year ago

if run_differential set to False, CONTRAST_KEY variable is not created. This causes the following error:

NameError in line 133 of /SAN/vyplab/sbs_projects/pipelines/doubles/triples/PAPA/rules/differential_apa.smk:
name 'CONTRAST_NAME' is not defined
  File "/SAN/vyplab/sbs_projects/pipelines/doubles/triples/PAPA/Snakefile", line 71, in <module>
  File "/SAN/vyplab/sbs_projects/pipelines/doubles/triples/PAPA/rules/differential_apa.smk", line 133, in <module>

Solution is to no longer wrap the construction of the variable in the if loop, or alternatively the contrast name can be set to a dummy value (e.g. NULL). I think dummy value would be preferable as can allow users to not provide two conditions in sample table if wish to not run differential usage analysis.