NAN as gene name in sc.get.rank_genes_groups_df
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
- [x ] I have checked that this issue has not already been reported.
- [x ] I have confirmed this bug exists on the latest version of scanpy.
Hi, I am using scanpy rank gene function and always get NAN as gene names in the data frame results.
(I might have seen this bug before in this repo but I cant find it in today.)
Minimal code sample (that we can copy&paste without having any data)
sc.tl.rank_genes_groups(ad,groupby='tissue.id',use_raw=False,method='wilcoxon')
sc.tl.filter_rank_genes_groups(ad, min_fold_change=1,min_in_group_fraction=0.25,max_out_group_fraction=0.25,use_raw=False,key='rank_genes_groups')
sc.get.rank_genes_groups_df(ad,group=['Liver_Met'],key='rank_genes_groups_filtered')[:20]
names | scores | logfoldchanges | pvals | pvals_adj
-- | -- | -- | -- | --
HBB | 94.312996 | 4.962673 | 0.0 | 0.0
HBA2 | 86.154396 | 4.713093 | 0.0 | 0.0
NaN | 83.383812 | 3.280355 | 0.0 | 0.0
NaN | 77.977989 | 3.548592 | 0.0 | 0.0
S100A2 | 73.550644 | 3.764067 | 0.0 | 0.0
NaN | 66.913872 | 2.049016 | 0.0 | 0.0
NaN | 66.620399 | 1.637823 | 0.0 | 0.0
NaN | 66.236443 | 1.807056 | 0.0 | 0.0
NaN | 64.112152 | 2.446921 | 0.0 | 0.0
NaN | 64.083160 | 2.495992 | 0.0 | 0.0
HBA1 | 63.376114 | 4.161097 | 0.0 | 0.0
NaN | 63.009491 | 2.059168 | 0.0 | 0.0
NaN | 58.142750 | 2.201216 | 0.0 | 0.
Versions
anndata 0.7.5
scanpy 1.7.0
sinfo 0.3.1
PIL 7.2.0
anndata 0.7.5
appdirs 1.4.4
autoreload NA
backcall 0.2.0
bioservices 1.7.8
bs4 4.9.1
cairo 1.19.1
certifi 2020.12.05
cffi 1.14.4
chardet 3.0.4
colorama 0.4.3
colorlog NA
cycler 0.10.0
cython_runtime NA
dateutil 2.8.1
decorator 4.4.2
deprecated 1.2.10
easydev 0.9.38
future 0.18.2
future_fstrings NA
get_version 2.1
graphtools 1.5.2
gseapy 0.10.1
h5py 2.10.0
idna 2.10
igraph 0.8.2
ipykernel 5.3.4
ipython_genutils 0.2.0
ipywidgets 7.5.1
jedi 0.17.2
joblib 0.16.0
kiwisolver 1.2.0
legacy_api_wrap 1.2
leidenalg 0.8.1
llvmlite 0.34.0
louvain 0.7.0
lxml 4.5.2
magic 2.0.3
matplotlib 3.3.1
mkl 2.3.0
mpl_toolkits NA
natsort 7.1.1
numba 0.51.2
numexpr 2.7.1
numpy 1.19.1
packaging 20.8
pandas 1.2.1
parso 0.7.1
pexpect 4.8.0
phenograph 1.5.7
pickleshare 0.7.5
pkg_resources NA
prompt_toolkit 3.0.6
psutil 5.7.2
ptyprocess 0.6.0
pycparser 2.20
pygments 2.6.1
pygsp 0.5.1
pylab NA
pyparsing 2.4.7
pytz 2020.1
requests 2.24.0
requests_cache 0.5.2
sca NA
scanpy 1.7.0
scipy 1.6.1
scprep 1.0.5.post2
seaborn 0.10.1
setuptools_scm NA
sinfo 0.3.1
six 1.15.0
sklearn 0.23.2
soupsieve 2.0.1
statsmodels 0.11.1
storemagic NA
tables 3.6.1
tasklogger 1.0.0
texttable 1.6.2
threadpoolctl 2.1.0
tornado 6.0.4
traitlets 4.3.3
urllib3 1.25.10
wcwidth 0.2.5
wrapt 1.12.1
zmq 19.0.2
zope NA
IPython 7.17.0
jupyter_client 6.1.6
jupyter_core 4.6.3
notebook 6.1.3
Python 3.8.2 (default, May 7 2020, 20:00:49) [GCC 7.3.0]
Linux-3.10.0-957.12.2.el7.x86_64-x86_64-with-glibc2.10
64 logical CPU cores, x86_64
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported output with sc.tl.rank_genes_groups, sc.tl.filter_rank_genes_groups, and sc.get.rank_genes_groups_df using the supplied snippet and versions. Trace how filtered gene names are passed into the dataframe result, then add regression coverage showing that valid ranked genes are not returned as NaN.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100