scverse / scverse/scanpy

rank_genes_groups issues with ZScore data and filter_rank_genes_groups does not have layer option

Open
#1,827 0 comments 0 reactions 0 assignees View on GitHub

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.

Minimal code sample (that we can copy&paste without having any data)
sc.tl.rank_genes_groups(adz,groupby='Phenograph_cluster',layer='norm',use_raw=0,method='wilcoxon',key='rank_genes_groups')
sc.tl.filter_rank_genes_groups(adz, min_fold_change=1,min_in_group_fraction=0.2,max_out_group_fraction=0.5,key='rank_genes_groups',use_raw=0)
sc.pl.rank_genes_groups_dotplot(adz,key='rank_genes_groups_filtered',n_genes=10,vmax=5,cmap='coolwarm')
  1. When I did not provide layer option and only work with z score input. After filtering there is no genes left.
  2. When I add non-z score data into a layer and provide it to rank gene group. after filtering, no genes left even when I do min_fold 0, min_in_group 0, max out group 1. I think something is wrong on filtering step... I dont know what are the data it is looking. I checked the fold change stuff and it all looks normal after rank_genes_groups.
  3. if I change the X data to non- z score one, all look fine.
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
attr 20.1.0
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
cloudpickle 1.6.0
colorama 0.4.3
colorlog NA
cupy 7.8.0
cupyx NA
cycler 0.10.0
cython_runtime NA
cytoolz 0.11.0
dask 2021.03.1
dateutil 2.8.1
decorator 4.4.2
deprecated 1.2.10
easydev 0.9.38
fa2 NA
fastrlock 0.5
fsspec 0.8.7
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
iniconfig NA
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
pluggy 0.13.1
prompt_toolkit 3.0.6
psutil 5.7.2
ptyprocess 0.6.0
py 1.9.0
pyarrow 0.16.0
pycparser 2.20
pygments 2.6.1
pygsp 0.5.1
pylab NA
pyparsing 2.4.7
pytest 6.1.2
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.11.1
setuptools_scm NA
sinfo 0.3.1
six 1.15.0
sklearn 0.23.2
skmisc 0.1.3
soupsieve 2.0.1
statsmodels 0.11.1
storemagic NA
tables 3.6.1
tasklogger 1.0.0
tblib 1.7.0
texttable 1.6.2
threadpoolctl 2.1.0
tlz 0.11.0
toolz 0.11.1
tornado 6.0.4
tqdm 4.48.2
traitlets 4.3.3
typing_extensions NA
umap 0.4.6
urllib3 1.25.10
wcwidth 0.2.5
wrapt 1.12.1
yaml 5.4.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

Session information updated at 2021-05-03 16:30

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported calls to rank_genes_groups, filter_rank_genes_groups, and rank_genes_groups_dotplot using the issue's layer and z-score cases. Start by tracing how rank_genes_groups and filter_rank_genes_groups select expression data, including use_raw and layer handling. Done means filtering behaves consistently for the documented inputs and a regression test covers the affected cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.