From 2c5d1b78468442f8720d001e55b35b2c10e8fb8d Mon Sep 17 00:00:00 2001 From: Erik Fasterius Date: Fri, 5 Jan 2024 14:04:51 +0100 Subject: [PATCH] Remove unintuitive `st_preprocess_fig_size` param Remove the unintuitive `st_preprocess_fig_size` parameter. This was only used one occasion in the pipeline, where it only affected a single report figure - all other figures hard hard-coded sizes. This brings all figures in line in that all sizes are hard-coded. This should possibly be changed in the future, but giving users the ability to change figure sizes on a pipeline-level would be difficult, since it may be that not all figures can look good with the same size across the board. --- bin/st_qc_and_normalisation.qmd | 19 +++++++++---------- docs/usage.md | 1 - modules/local/st_qc_and_normalisation.nf | 1 - nextflow.config | 1 - nextflow_schema.json | 6 ------ 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/bin/st_qc_and_normalisation.qmd b/bin/st_qc_and_normalisation.qmd index 14a347e..d526d7d 100644 --- a/bin/st_qc_and_normalisation.qmd +++ b/bin/st_qc_and_normalisation.qmd @@ -24,7 +24,6 @@ resolution = 1 saveFileST = None rawAdata = None # Name of the h5ad file -pltFigSize = 6 # Figure size minCounts = 500 # Min counts per spot minGenes = 250 # Min genes per spot minCells = 1 # Min cells per gene @@ -44,7 +43,7 @@ import matplotlib.pyplot as plt import seaborn as sns from IPython.display import display, Markdown -plt.rcParams["figure.figsize"] = (pltFigSize, pltFigSize) +plt.rcParams["figure.figsize"] = (6, 6) ``` ## Anndata object @@ -113,15 +112,15 @@ p = sns.histplot( st_adata.obs["total_counts"], kde=True, ax=axs[0, 0] ).set(title=f"Total counts") p = sns.histplot( - st_adata.obs["total_counts"][st_adata.obs["total_counts"] < histplotQCmaxTotalCounts], + st_adata.obs["total_counts"][st_adata.obs["total_counts"] < histplotQCmaxTotalCounts], kde=True, bins=histplotQCbins, ax=axs[0, 1] ).set(title=f"Total counts < {histplotQCmaxTotalCounts}") p = sns.histplot( - st_adata.obs["n_genes_by_counts"], - kde=True, - bins=histplotQCbins, + st_adata.obs["n_genes_by_counts"], + kde=True, + bins=histplotQCbins, ax=axs[1, 0] ).set(title=f"Genes by counts") p = sns.histplot( @@ -186,15 +185,15 @@ p = sns.histplot( st_adata.obs["total_counts"], kde=True, ax=axs[0, 0] ).set(title=f"Total counts") p = sns.histplot( - st_adata.obs["total_counts"][st_adata.obs["total_counts"] < histplotQCmaxTotalCounts], + st_adata.obs["total_counts"][st_adata.obs["total_counts"] < histplotQCmaxTotalCounts], kde=True, bins=histplotQCbins, ax=axs[0, 1] ).set(title=f"Total counts < {histplotQCmaxTotalCounts}") p = sns.histplot( - st_adata.obs["n_genes_by_counts"], - kde=True, - bins=histplotQCbins, + st_adata.obs["n_genes_by_counts"], + kde=True, + bins=histplotQCbins, ax=axs[1, 0] ).set(title=f"Genes by counts") p = sns.histplot( diff --git a/docs/usage.md b/docs/usage.md index e255a6f..13a6921 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -141,7 +141,6 @@ The following parameters are exposed for preprocessing: - `--st_preprocess_min_counts`: Minimum number of counts for a spot to be considered in the analysis. - `--st_preprocess_min_genes`: Minimum number of genes expressed in a spot for the spot to be considered. - `--st_preprocess_min_cells`: Minimum number of spots expressing a gene for the gene to be considered. -- `--st_preprocess_fig_size`: The figure size for the plots generated during preprocessing (_e.g._, quality control plots). - `--st_preprocess_hist_qc_max_total_counts`: Maximum total counts for the histogram plot in quality control. - `--st_preprocess_hist_qc_min_gene_counts`: Minimum gene counts for the histogram plot in quality control. - `--st_preprocess_hist_qc_bins`: Number of bins for the histogram plot in quality control. diff --git a/modules/local/st_qc_and_normalisation.nf b/modules/local/st_qc_and_normalisation.nf index 6405c12..e268ffb 100644 --- a/modules/local/st_qc_and_normalisation.nf +++ b/modules/local/st_qc_and_normalisation.nf @@ -38,7 +38,6 @@ process ST_QC_AND_NORMALISATION { quarto render ${report} \ --output st_qc_and_normalisation.html \ -P rawAdata:${st_raw} \ - -P pltFigSize:${params.st_preprocess_fig_size} \ -P minCounts:${params.st_preprocess_min_counts} \ -P minGenes:${params.st_preprocess_min_genes} \ -P minCells:${params.st_preprocess_min_cells} \ diff --git a/nextflow.config b/nextflow.config index b25e307..58fb589 100644 --- a/nextflow.config +++ b/nextflow.config @@ -18,7 +18,6 @@ params { spaceranger_save_reference = false // Preprocessing, QC and normalisation - st_preprocess_fig_size = 6 st_preprocess_min_counts = 500 st_preprocess_min_genes = 250 st_preprocess_min_cells = 1 diff --git a/nextflow_schema.json b/nextflow_schema.json index 31648bf..8fce53e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -95,12 +95,6 @@ "fa_icon": "fas fa-magnifying-glass-chart", "description": "Options related to the downstream analyses performed by the pipeline.", "properties": { - "st_preprocess_fig_size": { - "type": "integer", - "default": 6, - "description": "The size of the QC figures, in inches.", - "fa_icon": "fas fa-up-right-and-down-left-from-center" - }, "st_preprocess_min_counts": { "type": "integer", "default": 500,