Skip to content

Commit

Permalink
Remove unintuitive st_preprocess_fig_size param
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fasterius committed Jan 5, 2024
1 parent 47f4f7f commit 2c5d1b7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 19 deletions.
19 changes: 9 additions & 10 deletions bin/st_qc_and_normalisation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
1 change: 0 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion modules/local/st_qc_and_normalisation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand Down
1 change: 0 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2c5d1b7

Please sign in to comment.