Skip to content

filter_genes_dispersion(adata, n_top_genes=x) retrieves fewer genes if zero-expression genes exist #115

Closed

Description

@gokceneraslan

I was trying to get top 1000 variable genes in 1.3M dataset, but every time I ended up with zero genes after the sc.pp.filter_genes_dispersion(adata, n_top_genes=1000) call.

The reason is that sc.pp.filter_genes_dispersion(adata, n_top_genes=x) actually returns x - num_zero_expression_genes genes instead of x, where num_zero_expression_genes represents number of genes without any expression.

Here is a small reproducible example:

image

It's easy to fix with a prior sc.pp.filter_genes(adata, min_counts=1) call, but I think filter_genes_dispersion should retrieve n_top_genes, regardless of presence of zero expression genes.

Activity

  1. changed the title [-]sc.pp.filter_genes_dispersion(adata, n_top_genes=x) returns x - num_zero_expression_genes[/-] [+]filter_genes_dispersion(adata, n_top_genes=x) retrieves fewer genes if zero-expression genes exist[/+] on Apr 2, 2018
  2. added a commit that references this issue on Apr 27, 2018
    8ac4bce
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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