Skip to content

Commit aa03455

Browse files
Replace SatuRn with DEXSeq (#47)
* switch saturn for dexseq in differential_apa * remove mentions to saturn and associated scripts * add dexseq_apa to cluster.yaml
1 parent 66a77e7 commit aa03455

14 files changed

Lines changed: 663 additions & 585 deletions

Snakefile

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ if config["run_identification"] and config["use_precomputed_salmon_index"]:
5252
sys.stderr.write("run_identification will be overridden and pre-provided salmon index, id and info tables will be used\n")
5353

5454

55+
# If differential, make sure that sample table only has two conditions & to set a contrast name
56+
if config["run_differential"]:
57+
assert sample_tbl["condition"].nunique() == 2, f"condition column in sample table must only contain two distinct conditions, following n found - {sample_tbl['condition'].nunique()}"
58+
# firs key in sample table condition column = base_key
59+
BASE_KEY = sample_tbl["condition"][0]
60+
CONTRAST_KEY = sample_tbl.loc[sample_tbl["condition"] != BASE_KEY, "condition"][0]
61+
CONTRAST_NAME = CONTRAST_KEY + "vs" + BASE_KEY
62+
sys.stderr.write(f"Inferred base key for condition - {BASE_KEY}\n")
63+
sys.stderr.write(f"Inferred contrast key for condition - {CONTRAST_KEY}\n")
64+
sys.stderr.write(f"Constructed contrast name - {CONTRAST_NAME}\n")
65+
66+
5567
include: "rules/filter_gtf.smk"
5668
include: "rules/stringtie.smk"
5769
include: "rules/tx_filtering.smk"
@@ -60,15 +72,15 @@ include: "rules/differential_apa.smk"
6072

6173
# sys.stderr.write(OPTIONS + "\n")
6274

63-
localrules: all, gtf_list_by_condition, gtf_list_all_tpm_filtered, check_per_sample_mean_tpm_filtered
75+
localrules: all, gtf_list_by_condition, gtf_list_all_tpm_filtered, check_per_sample_mean_tpm_filtered, make_formulas_txt
6476

6577
wildcard_constraints:
6678
sample = "|".join(SAMPLES),
6779
condition = "|".join(CONDITIONS)
6880

6981
rule all:
7082
input:
71-
rules.process_saturn_tbl.output.processed_tbl if config["run_differential"] else rules.tx_to_le_quant.output.ppau,
83+
rules.process_dexseq_tbl.output if config["run_differential"] else rules.tx_to_le_quant.output.ppau,
7284
rules.tx_to_le_quant.output.counts,
7385
os.path.join(DAPA_SUBDIR,
7486
"summarised_pas_quantification.tpm.tsv"),
@@ -78,20 +90,3 @@ rule all:
7890
# sample=SAMPLES,
7991
# ),
8092

81-
82-
83-
# def get_stringtie_assembled(sample, output_dir):
84-
# '''
85-
# Return path to target StringTie transcriptome assembly
86-
#
87-
# Want functionality to provide a range of parameter values in same pipeline
88-
# and Snakemake's Paramspace docs aren't quite cutting it right now...
89-
#
90-
# If provide a list for given parameter, will perform assembly for each combo of values
91-
# min_isoform_fraction_abundance (-f)
92-
# min_junction_reads (-j)
93-
# min_transcript_coverage (-c) (minimum reads per bp coverage)
94-
# To be added: disable_end_trimming (-t), point-features (--ptf)
95-
# '''
96-
#
97-
# if isinstance(list(), config["min_isoform_fraction_abundance"]):

config/cluster.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,8 @@ tx_to_le_quant:
100100
h_rt: 4:00:00
101101
submission_string: " "
102102

103+
dexseq_apa:
104+
h_vmem: 10G
105+
tmem: 10G
106+
submission_string: "-pe smp 2 -R y"
107+
h_rt: 12:00:00

config/config.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pre_stringtie_processing: "none"
6868
# If False, pipeline jumps to generating a GTF of last exons from the reference input only
6969
run_identification: True
7070

71-
# Whether to run differential usage analysis with SatuRn - bool
71+
# Whether to run differential usage analysis with DEXSeq - bool
7272
# If False, pipeline terminates after generating matrices of summarised quantification for each 'last exon isoform'
7373
run_differential: True
7474

@@ -79,7 +79,7 @@ use_provided_novel_les: False
7979
# Whether to use pre-computed salmon index to quantify samples. Useful if wish to quantify multiple datasets with a common annotation and wish to save on unnecessary computation
8080
# Note: If set to True, run_identification will be overriden
8181
# Note: You will also need to provide the tx2le, tx2gene, le2gene and 'info' tables produced for the same run.
82-
use_precomputed_salmon_index: True
82+
use_precomputed_salmon_index: False
8383

8484

8585
###
@@ -308,8 +308,17 @@ precomputed_info_tbl: "tests/dryruns/novel_ref_combined.info.tsv"
308308
# Default: 10
309309
min_mean_count: 10
310310

311-
# Number of threads to use for SatuRn analysis
312-
saturn_threads: 2
311+
# Minimum mean relative usage of an isoform in either base/contrast condition for it to be retained for differential usage analysis
312+
# see https://doi.org/10.1186/s13059-015-0862-3
313+
# Note: provide value in fractional terms (i.e. between 0 & 0.5)
314+
min_relative_usage: 0.05
315+
316+
317+
dexseq_formula_full: "~ sample_name + exon + condition:exon"
318+
dexseq_formula_reduced: "~ sample_name + exon"
319+
320+
# Number of threads to use for DEXSeq analysis
321+
dexseq_threads: 2
313322

314323
#####-----------------------------------------
315324
# OUTPUT SUBDIRECTORY NAMES

0 commit comments

Comments
 (0)