Skip to content

Commit 5575551

Browse files
committed
refactorize docs/wiki plots
1 parent 661d623 commit 5575551

5 files changed

Lines changed: 125 additions & 121 deletions

File tree

workflow/Snakefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ for ds in config["workflows"]:
3636
include: os.path.join("rules", "CorcesRNA.smk")
3737
include: os.path.join("rules", "CorcesATAC.smk")
3838
include: os.path.join("rules", "CorcesINT.smk")
39+
include: os.path.join("rules", "docs.smk")
3940

4041

4142
#### Target Rule ####
@@ -54,7 +55,6 @@ rule all:
5455
rules.CorcesRNA_dea_limma_all.input,
5556
rules.CorcesRNA_enrichment_analysis_all.input,
5657
rules.CorcesRNA_reconstruct_lineage.output, # custom rule
57-
rules.CorcesRNA_plots.output, # custom rule; use only for docs; commented
5858
#### ATAC-seq Analysis Recipe (CorcesATAC) ####
5959
rules.CorcesATAC_fetch_ngs_all.input,
6060
rules.CorcesATAC_get_resources.output, # custom rule
@@ -65,14 +65,16 @@ rule all:
6565
rules.CorcesATAC_dea_limma_all.input,
6666
rules.CorcesATAC_enrichment_analysis_all.input,
6767
rules.CorcesATAC_reconstruct_lineage.output, # custom rule
68-
rules.CorcesATAC_plots.output, # custom rule; use only for docs; commented
6968
#### Integrative Analysis Recipe (CorcesINT) ####
7069
rules.CorcesINT_spilterlize_integrate_all.input,
7170
rules.CorcesINT_unsupervised_analysis_all.input,
7271
rules.CorcesINT_dea_limma_all.input,
7372
rules.CorcesINT_plot_correlation.output, # custom rule for divergent gene visualization
7473
rules.CorcesINT_enrichment_analysis_all.input,
75-
rules.CorcesINT_plots.output, # custom rule; use only for docs; commented
74+
#### Custom rules used only for docs/wiki (keep commented) ####
75+
rules.CorcesRNA_plots.output,
76+
rules.CorcesATAC_plots.output,
77+
rules.CorcesINT_plots.output,
7678
default_target: True # important for module usage
7779
threads: 1
7880
resources:

workflow/rules/CorcesATAC.smk

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -140,43 +140,3 @@ rule CorcesATAC_reconstruct_lineage:
140140
os.path.join("logs","rules","CorcesATAC_reconstruct_lineage.log"),
141141
script:
142142
"../scripts/crossprediction.py"
143-
144-
#### CorcesATAC - Copy selected plots for documentation and visualization in wiki (custom rule) ####
145-
# Define the mapping of input to output files
146-
CorcesATAC_plots_map = {
147-
"sample_annotation.png": "results/CorcesATAC/atacseq_pipeline/report/sample_annotation.png",
148-
"CD34.svg": "results/CorcesATAC/genome_tracks/tracks/CD34.svg",
149-
"MS4A1.svg": "results/CorcesATAC/genome_tracks/tracks/MS4A1.svg",
150-
"filtered.png": "results/CorcesATAC/spilterlize_integrate/all/plots/filtered.png",
151-
"normCQN_integrated.png": "results/CorcesATAC/spilterlize_integrate/all/plots/normCQN_integrated.png",
152-
"filtered_CFA.png": "results/CorcesATAC/spilterlize_integrate/all/plots/filtered_CFA.png",
153-
"normCQN_integrated_CFA.png": "results/CorcesATAC/spilterlize_integrate/all/plots/normCQN_integrated_CFA.png",
154-
"normCQN_integrated_PCA.png": "results/CorcesATAC/unsupervised_analysis/normCQN_integrated/PCA/plots/PCA_auto_0.9_2/metadata/cell_type.png",
155-
"normCQN_integrated_HVF_PCA.png": "results/CorcesATAC/unsupervised_analysis/normCQN_integrated_HVF/PCA/plots/PCA_auto_0.9_2/metadata/cell_type.png",
156-
"normCQN_integrated_UMAP.png": "results/CorcesATAC/unsupervised_analysis/normCQN_integrated/UMAP/plots/UMAP_correlation_15_0.1_2/metadata/cell_type.png",
157-
"normCQN_integrated_HVF_UMAP.png": "results/CorcesATAC/unsupervised_analysis/normCQN_integrated_HVF/UMAP/plots/UMAP_correlation_15_0.1_2/metadata/cell_type.png",
158-
"dea_stats.png": "results/CorcesATAC/dea_limma/normCQN_OvA_cell_type/plots/stats.png",
159-
"markerGenes.png": "results/CorcesATAC/dea_limma/normCQN_OvA_cell_type/plots/heatmap/markerGenes.png",
160-
"Bcell_up_ReactomePathways.png": "results/CorcesATAC/enrichment_analysis/Bcell_up/GREAT/ReactomePathways/Bcell_up_ReactomePathways.png",
161-
"Bcell_up_Azimuth_2023.png": "results/CorcesATAC/enrichment_analysis/Bcell_up/GREAT/Azimuth_2023/Bcell_up_Azimuth_2023.png",
162-
"cell_types_Azimuth_2023_summary.png": "results/CorcesATAC/enrichment_analysis/cell_types_up/GREAT/Azimuth_2023/cell_types_up_Azimuth_2023_summary.png",
163-
"cell_types_ReactomePathways_summary.png": "results/CorcesATAC/enrichment_analysis/cell_types_up/GREAT/ReactomePathways/cell_types_up_ReactomePathways_summary.png",
164-
"crossprediction_graph.png": "results/CorcesATAC/special_analyses/crossprediction/graph.png",
165-
}
166-
167-
# Copy input to outputs to include the plots in the repo and wiki
168-
# This rule can only be used for docs after all results (including untracked ones: volcano and unsupervised analysis plots)
169-
# have been generated (i.e. leave commented in the Snakefile's target rule until the end/last iteration)
170-
rule CorcesATAC_plots:
171-
input:
172-
[CorcesATAC_plots_map[plot] for plot in CorcesATAC_plots_map]
173-
output:
174-
[f"docs/CorcesATAC/{plot}" for plot in CorcesATAC_plots_map]
175-
resources:
176-
mem_mb="1000",
177-
threads: config.get("threads", 1)
178-
log:
179-
"logs/rules/CorcesATAC_plots.log",
180-
run:
181-
for i, o in zip(input, output):
182-
shell(f"cp {i} {o}")

workflow/rules/CorcesINT.smk

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -106,41 +106,3 @@ module CorcesINT_enrichment_analysis:
106106
config_wf["CorcesINT_enrichment_analysis"]
107107

108108
use rule * from CorcesINT_enrichment_analysis as CorcesINT_enrichment_analysis_*
109-
110-
#### CorcesINT - Copy selected plots for documentation and visualization in wiki (custom rule) ####
111-
# Define the mapping of input to output files
112-
CorcesINT_plots_map = {
113-
"filtered.png": "results/CorcesINT/spilterlize_integrate/all/plots/filtered.png",
114-
"normupperquartile_integrated.png": "results/CorcesINT/spilterlize_integrate/all/plots/normupperquartile_integrated.png",
115-
"filtered_CFA.png": "results/CorcesINT/spilterlize_integrate/all/plots/filtered_CFA.png",
116-
"normupperquartile_integrated_CFA.png": "results/CorcesINT/spilterlize_integrate/all/plots/normupperquartile_integrated_CFA.png",
117-
"normupperquartile_integrated_PCA_cell_type.png": "results/CorcesINT/unsupervised_analysis/normupperquartile_integrated/PCA/plots/PCA_auto_0.9_2/metadata/cell_type.png",
118-
"normupperquartile_integrated_UMAP_cell_type.png": "results/CorcesINT/unsupervised_analysis/normupperquartile_integrated/UMAP/plots/UMAP_correlation_15_0.1_2/metadata/cell_type.png",
119-
"normupperquartile_integrated_PCA_modality.png": "results/CorcesINT/unsupervised_analysis/normupperquartile_integrated/PCA/plots/PCA_auto_0.9_2/metadata/modality.png",
120-
"normupperquartile_integrated_UMAP_modality.png": "results/CorcesINT/unsupervised_analysis/normupperquartile_integrated/UMAP/plots/UMAP_correlation_15_0.1_2/metadata/modality.png",
121-
"dea_stats.png": "results/CorcesINT/dea_limma/normupperquartile_integrated/plots/stats.png",
122-
"markerGenes.png": "results/CorcesINT/dea_limma/normupperquartile_integrated/plots/heatmap/markerGenes.png",
123-
"HSC_correlation.png": "results/CorcesINT/special_analysis/correlation_plots/HSC_correlation.png",
124-
"Mono_correlation.png": "results/CorcesINT/special_analysis/correlation_plots/Mono_correlation.png",
125-
"cell_types_GO_Biological_Process_2025_summary.png": "results/CorcesINT/enrichment_analysis/cell_types/preranked_GSEApy/GO_Biological_Process_2025/cell_types_GO_Biological_Process_2025_summary.png",
126-
"cell_types_ReactomePathways_summary.png": "results/CorcesINT/enrichment_analysis/cell_types/preranked_GSEApy/ReactomePathways/cell_types_ReactomePathways_summary.png",
127-
"Mono_EP.png": "results/CorcesINT/enrichment_analysis/Mono_EP/RcisTarget/hg38_500bp_up_100bp_down_v10clust/Mono_EP_hg38_500bp_up_100bp_down_v10clust.png",
128-
"Mono_TA.png": "results/CorcesINT/enrichment_analysis/Mono_TA/RcisTarget/hg38_500bp_up_100bp_down_v10clust/Mono_TA_hg38_500bp_up_100bp_down_v10clust.png",
129-
}
130-
131-
# Copy input to outputs to include the plots in the repo and wiki
132-
# This rule can only be used for docs after all results (including untracked ones: volcano and unsuervised analysis plots)
133-
# have been generated (i.e. leave commented in the Snakefile's target rule until the end/last iteration)
134-
rule CorcesINT_plots:
135-
input:
136-
[CorcesINT_plots_map[plot] for plot in CorcesINT_plots_map]
137-
output:
138-
[f"docs/CorcesINT/{plot}" for plot in CorcesINT_plots_map]
139-
resources:
140-
mem_mb="1000",
141-
threads: config.get("threads", 1)
142-
log:
143-
"logs/rules/CorcesINT_plots.log",
144-
run:
145-
for i, o in zip(input, output):
146-
shell(f"cp {i} {o}")

workflow/rules/CorcesRNA.smk

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -90,43 +90,3 @@ rule CorcesRNA_reconstruct_lineage:
9090
os.path.join("logs","rules","CorcesRNA_reconstruct_lineage.log"),
9191
script:
9292
"../scripts/crossprediction.py"
93-
94-
#### CorcesRNA - Copy selected plots for documentation and visualization in wiki (custom rule) ####
95-
# Define the mapping of input to output files
96-
CorcesRNA_plots_map = {
97-
"sample_annotation.png": "results/CorcesRNA/rnaseq_pipeline/report/sample_annotation.png",
98-
"CD34.svg": "results/CorcesRNA/genome_tracks/tracks/CD34.svg",
99-
"MS4A1.svg": "results/CorcesRNA/genome_tracks/tracks/MS4A1.svg",
100-
"filtered.png": "results/CorcesRNA/spilterlize_integrate/all/plots/filtered.png",
101-
"normCQN_integrated.png": "results/CorcesRNA/spilterlize_integrate/all/plots/normCQN_integrated.png",
102-
"filtered_CFA.png": "results/CorcesRNA/spilterlize_integrate/all/plots/filtered_CFA.png",
103-
"normCQN_integrated_CFA.png": "results/CorcesRNA/spilterlize_integrate/all/plots/normCQN_integrated_CFA.png",
104-
"normCQN_integrated_PCA.png": "results/CorcesRNA/unsupervised_analysis/normCQN_integrated/PCA/plots/PCA_auto_0.9_2/metadata/cell_type.png",
105-
"normCQN_integrated_HVF_PCA.png": "results/CorcesRNA/unsupervised_analysis/normCQN_integrated_HVF/PCA/plots/PCA_auto_0.9_2/metadata/cell_type.png",
106-
"normCQN_integrated_UMAP.png": "results/CorcesRNA/unsupervised_analysis/normCQN_integrated/UMAP/plots/UMAP_correlation_15_0.1_2/metadata/cell_type.png",
107-
"normCQN_integrated_HVF_UMAP.png": "results/CorcesRNA/unsupervised_analysis/normCQN_integrated_HVF/UMAP/plots/UMAP_correlation_15_0.1_2/metadata/cell_type.png",
108-
"dea_stats.png": "results/CorcesRNA/dea_limma/normCQN_OvA_cell_type/plots/stats.png",
109-
"markerGenes.png": "results/CorcesRNA/dea_limma/normCQN_OvA_cell_type/plots/heatmap/markerGenes.png",
110-
"Bcell_ReactomePathways.png": "results/CorcesRNA/enrichment_analysis/Bcell/preranked_GSEApy/ReactomePathways/Bcell_ReactomePathways.png",
111-
"Bcell_Azimuth_2023.png": "results/CorcesRNA/enrichment_analysis/Bcell/preranked_GSEApy/Azimuth_2023/Bcell_Azimuth_2023.png",
112-
"cell_types_Azimuth_2023_summary.png": "results/CorcesRNA/enrichment_analysis/cell_types/preranked_GSEApy/Azimuth_2023/cell_types_Azimuth_2023_summary.png",
113-
"cell_types_ReactomePathways_summary.png": "results/CorcesRNA/enrichment_analysis/cell_types/preranked_GSEApy/ReactomePathways/cell_types_ReactomePathways_summary.png",
114-
"crossprediction_graph.png": "results/CorcesRNA/special_analyses/crossprediction/graph.png",
115-
}
116-
117-
# Copy input to outputs to include the plots in the repo and wiki
118-
# This rule can only be used for docs after all results (including untracked ones: volcano and unsupervised analysis plots)
119-
# have been generated (i.e. leave commented in the Snakefile's target rule until the end/last iteration)
120-
rule CorcesRNA_plots:
121-
input:
122-
[CorcesRNA_plots_map[plot] for plot in CorcesRNA_plots_map]
123-
output:
124-
[f"docs/CorcesRNA/{plot}" for plot in CorcesRNA_plots_map]
125-
resources:
126-
mem_mb="1000",
127-
threads: config.get("threads", 1)
128-
log:
129-
"logs/rules/CorcesRNA_plots.log",
130-
run:
131-
for i, o in zip(input, output):
132-
shell(f"cp {i} {o}")

0 commit comments

Comments
 (0)