Skip to content

Commit

Permalink
Updates to workflow for multiple datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
gibsramen committed Aug 15, 2022
1 parent c32de57 commit ab1c406
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.snakemake
*__pycache__
*egg-info/
config/datasets.tsv
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
graft workflow
graft config
2 changes: 0 additions & 2 deletions config/datasets.tsv

This file was deleted.

42 changes: 20 additions & 22 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pandas as pd

configfile: "config/config.yaml"


Expand All @@ -10,23 +8,23 @@ include: "rules/ml.smk"


report: "report/workflow.rst"
#
#
#rule all:
# input:
# all_input,
#
#
#rule all_differentials:
# input:
# all_diff_files,
#
#
#rule all_ml:
# input:
# all_ml,
#
#
#rule all_visualizations:
# input:
# all_viz_files,


rule all:
input:
all_input,


rule all_differentials:
input:
all_differentials,


rule all_ml:
input:
all_ml,


rule all_visualizations:
input:
all_viz_files,
39 changes: 39 additions & 0 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,42 @@ def get_diffab_tool_columns(wildcards):
"corncob": "coefs",
}
return columns[wildcards.tool]


all_differentials = expand(
"results/{dataset}/{out}",
dataset=names,
out=["concatenated_differentials.tsv", "qurro", "differentials_table.html"]
)

all_ml = expand(
"results/{dataset}/ml/{tool}/regression/model_data.pctile_{pctile}.joblib",
dataset=names,
tool=config["tools"] + ["pca_pc1"],
pctile=config["log_ratio_feat_pcts"],
)

all_viz_files = expand(
"figures/{dataset}/{tool}_differentials.svg",
dataset=names,
tool=config["tools"]
)
all_viz_files.extend(expand(
"figures/{dataset}/{viz}",
dataset=names,
viz=["spearman_heatmap.svg", "rank_comparisons.html", "pca.svg"]
))
all_viz_files.extend(expand(
"figures/{dataset}/upset/upset.pctile_{pctile}.{location}.svg",
dataset=names,
pctile=config["log_ratio_feat_pcts"],
location=["numerator", "denominator"],
))
all_viz_files.extend(expand(
"figures/{dataset}/{curve}/{curve}.pctile_{pctile}.svg",
dataset=names,
pctile=config["log_ratio_feat_pcts"],
curve=["pr", "roc"],
))

all_input = all_differentials + all_viz_files + all_ml

0 comments on commit ab1c406

Please sign in to comment.