From af40fe7da9f60e41140bd9016e53a38b15606362 Mon Sep 17 00:00:00 2001 From: sreichl Date: Fri, 15 Dec 2023 19:58:11 +0100 Subject: [PATCH] fix clustering selection based on configs --- config/config.yaml | 3 +-- workflow/Snakefile | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 9af51f0..9320df1 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -69,7 +69,7 @@ clustree: numerical_aggregation_option: "mean" # aggregation function for numerical metadata, options: mean, median, max, min ##### cluster validation #### -# Cluster validation using inrternal cluster indices is computationally very expensive. +# Cluster validation using internal cluster indices is computationally very expensive. # To reduce complexity and increase performance as proportion of samples can be used for the internal cluster evaluation. sample_proportion: 1 # float 0-1, >500 samples should be included. @@ -91,7 +91,6 @@ scatterplot2d: size: 1 alpha: 1 - # specify features of interest, which values from the data, will be highlgihted in the 2D/3D plots # motivated by bioinformatics highlighting expression levels of marker genes (eg: ['PTPRC']) # if not used leave empty [] diff --git a/workflow/Snakefile b/workflow/Snakefile index bcd3141..46a237b 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -28,10 +28,10 @@ clustree_metadata_content = [] indices_external = [] indices_internal = [] -if len(config["leiden"]["metrics"])>0: +if len(config["leiden"]["metrics"])>0 and all([leiden_metric in config["umap"]["metrics"] for leiden_metric in config["leiden"]["metrics"]]): cluster_methods.append("Leiden") -if len(config["clustification"]["method"])!="": +if len(config["clustification"]["method"])!="" and config["clustification"]["method"] in cluster_methods: cluster_methods.append("clustification") # Dimensionality Reduction: apply PCA, UMAP and densMAP sepcific visualization flags @@ -67,7 +67,6 @@ if len(cluster_methods) > 0: if len(config["metadata_of_interest"])>0: clustree_content.append('custom') - ruleorder: clustification > aggregate_clustering_results rule all: