You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
filter_genes_dispersion(adata, n_top_genes=x) retrieves fewer genes if zero-expression genes exist #115
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:
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.
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
Activity
[-]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[/+]Exclude nans from normalized dispersion vector