Skip to content

Commit

Permalink
Fix seurat
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Dec 18, 2023
1 parent 266c054 commit 8efef36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scanpy/preprocessing/_highly_variable_genes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

import warnings
from typing import Literal
from inspect import signature
from typing import Literal, cast

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -328,7 +329,7 @@ def highly_variable_genes(
max_disp: float | None = np.inf,
min_mean: float | None = 0.0125,
max_mean: float | None = 3,
span: float | None = 0.3,
span: float = 0.3,
n_bins: int = 20,
flavor: Literal["seurat", "cell_ranger", "seurat_v3"] = "seurat",
subset: bool = False,
Expand Down Expand Up @@ -455,6 +456,9 @@ def highly_variable_genes(
)

if flavor == "seurat_v3":
if n_top_genes is None:
sig = signature(_highly_variable_genes_seurat_v3)
n_top_genes = cast(int, sig.parameters["n_top_genes"].default)
return _highly_variable_genes_seurat_v3(
adata,
layer=layer,
Expand Down

0 comments on commit 8efef36

Please sign in to comment.