Skip to content

Commit

Permalink
feat: add parameter to make go_enrichment optional
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed May 29, 2024
1 parent 220d9ea commit b99882b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
7 changes: 4 additions & 3 deletions .test/config_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ samplemanifest: "/opt2/.test/samples.test_lintr.tsv"
# User parameters
#####################################################################################
# run sample contrasts
run_contrasts: "Y" # Y or N
run_contrasts: true
contrasts: "/opt2/.test/contrasts.test.tsv" # run_contrasts needs to be "Y"
contrasts_fdr_cutoff: "0.05"
contrasts_lfc_cutoff: "0.59" # FC of 1.5
contrasts_fdr_cutoff: 0.05
contrasts_lfc_cutoff: 0.59 # FC of 1.5
run_go_enrichment: true

# reference
genome: "hg38" # currently supports hg38, hg19 and mm10. Custom genome can be added with appropriate additions to "reference" section below.
Expand Down
9 changes: 5 additions & 4 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ samplemanifest: "WORKDIR/config/samples.tsv"
# User parameters
#####################################################################################
# run sample contrasts
run_contrasts: "Y" # Y or N
contrasts: "WORKDIR/config/contrasts.tsv" # run_contrasts needs to be "Y"
contrasts_fdr_cutoff: "0.05"
contrasts_lfc_cutoff: "0.59" # FC of 1.5
run_contrasts: true # true or false, no quotes
contrasts: "WORKDIR/config/contrasts.tsv" # run_contrasts needs to be `true`
contrasts_fdr_cutoff: 0.05
contrasts_lfc_cutoff: 0.59 # FC of 1.5
run_go_enrichment: false # this step is long-running. use `true` if you would like to run it.

# reference
genome: "hg38" # currently supports hg38, hg19 and mm10. Custom genome can be added with appropriate additions to "reference" section below.
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/preparing-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The pipeline allows for the use of a species specific spike-in control, or the u

For example for ecoli spike-in:
```
run_contrasts: "Y"
run_contrasts: true
norm_method: "spikein"
spikein_genome: "ecoli"
spikein_reference:
Expand All @@ -41,7 +41,7 @@ spikein_reference:

For example for drosophila spike-in:
```
run_contrasts: "Y"
run_contrasts: true
norm_method: "spikein"
spikein_genome: "drosophila"
spikein_reference:
Expand Down
4 changes: 2 additions & 2 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def run_qc(wildcards):

def run_contrasts(wildcards):
files=[]
if config["run_contrasts"] == "Y":
if config["run_contrasts"]:
files.append(join(RESULTSDIR,"replicate_sample.tsv"))

# inputs for matrix
Expand Down Expand Up @@ -159,7 +159,7 @@ def get_rose(wildcards):

def get_enrichment(wildcards):
files=[]
if config["run_contrasts"] == "Y":
if config["run_contrasts"] and config['run_go_enrichment']:
if (GENOME == "hg19") or (GENOME == "hg38"):
if ("macs2_narrow" in PEAKTYPE) or ("macs2_broad" in PEAKTYPE):
t=expand(join(RESULTSDIR,"peaks","{qthresholds}","{peak_caller}","annotation","go_enrichment","{contrast_list}.{dupstatus}.txt"),peak_caller="macs2",qthresholds=QTRESHOLDS,contrast_list=CONTRAST_LIST,dupstatus=DUPSTATUS)
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/annotations.smk
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ rule rose:
echo "Less than 5 usable peaks detected (N=${{num_of_peaks}})" > {output.super_summit}
fi
"""
if config["run_contrasts"] == "Y":
if config["run_contrasts"]:
rule create_contrast_peakcaller_files:
"""
Reads in all of the output from Rules create_contrast_data_files which match the same peaktype and merges them together
Expand Down
2 changes: 1 addition & 1 deletion workflow/rules/init.smk
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ QTRESHOLDS=config["quality_thresholds"]
QTRESHOLDS=list(map(lambda x:x.strip(),QTRESHOLDS.split(",")))

# set contrast settings
if config["run_contrasts"] == "Y":
if config["run_contrasts"]:
print("#"*100)
print("# Checking constrasts to run...")
contrasts_table = config["contrasts"]
Expand Down

0 comments on commit b99882b

Please sign in to comment.