Skip to content

Commit 54a01cf

Browse files
Release 0.1.6 (#32)
* Allow kwargs to pass through in plot_relevant_genes_on_umap * Update project CI structure * Extract tutorial notebooks to another repo to keep this repo clean --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 497ae4d commit 54a01cf

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,5 @@ Code, notebooks, and instructions to reproduce the results from the paper are av
9696
[changelog]: https://drvi.readthedocs.io/latest/changelog.html
9797
[link-docs]: https://drvi.readthedocs.io
9898
[link-api]: https://drvi.readthedocs.io
99-
[link-tutorials]: https://drvi.readthedocs.io/latest/tutorials.html
99+
[link-tutorials]: https://drvi.readthedocs.io/latest/tutorials/index.html
100100
[link-pypi]: https://pypi.org/project/drvi-py

src/drvi/utils/plotting/_interpretability.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ def _umap_of_relevant_genes(
351351
dim_subset: Sequence[str] | None = None,
352352
n_top_genes: int = 10,
353353
max_cells_to_plot: int | None = None,
354+
**kwargs,
354355
):
355356
if max_cells_to_plot is not None and adata.n_obs > max_cells_to_plot:
356357
adata = sc.pp.subsample(adata, n_obs=max_cells_to_plot, copy=True)
@@ -376,7 +377,7 @@ def _umap_of_relevant_genes(
376377

377378
adata.obs[dim_title] = list(embed[adata.obs.index, embed.var[title_col] == real_dim_title].X[:, 0])
378379
ax = sc.pl.embedding(
379-
adata, "X_umap_method", color=[dim_title], cmap=_cmap, vcenter=0, show=False, frameon=False
380+
adata, "X_umap_method", color=[dim_title], cmap=_cmap, vcenter=0, show=False, frameon=False, **kwargs
380381
)
381382
ax.text(0.92, 0.05, ax.get_title(), size=15, ha="left", color="black", rotation=90, transform=ax.transAxes)
382383
ax.set_title("")
@@ -391,6 +392,7 @@ def _umap_of_relevant_genes(
391392
gene_symbols=gene_symbols,
392393
show=False,
393394
frameon=False,
395+
**kwargs,
394396
)
395397
if n_top_genes == 1 or len(relevant_genes) == 1:
396398
axes = [axes]
@@ -413,11 +415,21 @@ def plot_relevant_genes_on_umap(
413415
dim_subset: Sequence[str] = None,
414416
n_top_genes: int = 10,
415417
max_cells_to_plot: int | None = None,
418+
**kwargs,
416419
):
417420
plot_info = iterate_on_top_differential_vars(
418421
traverse_adata, traverse_adata_key, title_col, order_col, gene_symbols, score_threshold
419422
)
420423

421424
return _umap_of_relevant_genes(
422-
adata, embed, plot_info, layer, title_col, gene_symbols, dim_subset, n_top_genes, max_cells_to_plot
425+
adata,
426+
embed,
427+
plot_info,
428+
layer,
429+
title_col,
430+
gene_symbols,
431+
dim_subset,
432+
n_top_genes,
433+
max_cells_to_plot,
434+
**kwargs,
423435
)

0 commit comments

Comments
 (0)