Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rank_genes_groups_violin’s gene_symbols #2554

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added tests/_data/t-cells.h5ad
Binary file not shown.
19 changes: 19 additions & 0 deletions tests/test_rank_genes_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,25 @@ def test_wilcoxon_tie_correction(reference):
np.testing.assert_allclose(test_obj.stats[groups[0]]["pvals"], pvals)


def test_rank_gene_groups_violin_gene_symbols():
adata = sc.read_h5ad(DATA_PATH / "t-cells.h5ad")

t_celltypes = ["Naive CD4+ T cells", "Naive CD8+ T cells"]
sc.tl.rank_genes_groups(
adata,
groupby="cell_type",
groups=t_celltypes,
reference="rest",
method="wilcoxon",
use_raw=False,
)

# We get the KeyError here
sc.pl.rank_genes_groups_violin(
adata, groups=t_celltypes, n_genes=15, strip=False, gene_symbols="gene_symbols"
)


def test_wilcoxon_huge_data(monkeypatch):
max_size = 300
adata = pbmc68k_reduced()
Expand Down
Loading