Skip to content

Commit

Permalink
Added custom parameters for plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamie committed Jul 15, 2024
1 parent 51f127a commit 448c764
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions bin/QC.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,32 @@
"# UMAP before and after batch correction"
]
},
{
"cell_type": "markdown",
"id": "f56f1928",
"metadata": {},
"source": [
"### Custom parameters"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "589e39dd",
"metadata": {},
"outputs": [],
"source": [
"plots = plots.split(',')\n",
"for plot in plots: \n",
" print(plot)\n",
" fig, axes = plt.subplots(1, 2, figsize = (10, 5))\n",
" for i, adata in enumerate(adatas):\n",
" ax = axes[i%2]\n",
" sc.pl.umap(adata, color = plot, title = adata_names[i], show = False, ax = ax, frameon = False)\n",
" plt.tight_layout()\n",
" plt.show()"
]
},
{
"cell_type": "markdown",
"id": "c1ed930b-6797-490f-b571-dd022b2e2f28",
Expand Down
2 changes: 1 addition & 1 deletion modules/report/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ process REPORT {
fi
export HOME=/tmp/ipykernel
python -m ipykernel install --user --name postprocessing
papermill ${baseDir}/bin/QC.ipynb ${params.experiment.name}_report.ipynb
papermill ${baseDir}/bin/QC.ipynb ${params.experiment.name}_report.ipynb -p plots ${params.report.plots}
jupyter nbconvert --to html ${params.experiment.name}_report.ipynb
"""
}

0 comments on commit 448c764

Please sign in to comment.