-
Notifications
You must be signed in to change notification settings - Fork 580
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
Score genes - control genes index of wrong format #2153
Comments
I encountered the same problem, when I created a small artificial In this line scanpy/scanpy/tools/_score_genes.py Line 182 in 6314190
control_genes was actually empty, hence the index error.The reason for the empty control_genes genes isscanpy/scanpy/tools/_score_genes.py Line 173 in 6314190
control_genes contained some genes before (in my artificial case only one), but they are removed here, since the genes in control_genes also appeared in gene_list .
I think this is where the bug resides: scanpy/scanpy/tools/_score_genes.py Line 167 in 6314190
would need to be changed/complemented: An additional filter for not being a gene in gene_list should fix this issue, if I understand this code correctly.
That being said, I suppose that this issue appears rather rarely in the realistically sized datasets. I assume, that the probability of accidentally picking genes from |
This error happened to me too when working on a small dataset and scoring a single gene with ctrl_size=1. This happens at random in the following line: scanpy/scanpy/tools/_score_genes.py Line 168 in 383a61b
I was working on a small test dataset with limited features and calling the scanpy/scanpy/tools/_score_genes.py Line 258 in 383a61b
|
I’d consider the issue to be a bug, can we label it as such? |
I agree that this could be handled but does it actually make sense to score only 1 gene using this function? I feel like it assumes there is a group of genes. |
We ran across a case where score genes does not work for one specific gene, but works for others; the gene is in anndata. The same code works on other datasets preprocessed in the same way.
The text was updated successfully, but these errors were encountered: