Skip to content

HVG by cell_ranger flavor, n_top_genes not working #662

@mona-lit

Description

@mona-lit

Hi,

Im using scanpy 1.4.2 to analyze my data, using the following command:

sc.pp.highly_variable_genes(heart_cmc, flavor = 'cell_ranger', n_top_genes = 1000)

However, instead of getting 1000 HVG, it reports 1488 HVG. Similar thing happens with higher numbers of HVG (e.g. n_top_genes = 2000 returns 1999).

The scaling then fails with a following error:
ValueError: The first guess on the deviance function returned a nan. This could be a boundary problem and should be reported.

Any suggestions on how to fix it? When I dont specify n_top_genes, the thing runs without problems.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions