STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
178 stars 59 forks source link

Non-repeatable `highly_variable_genes` result #296

Open liuxiawei opened 2 weeks ago

liuxiawei commented 2 weeks ago

I was using the same file(md5 checked) for analysis on two different computers. On one computer, the results were normal (seemed to be without errors), but on the other, the highly_variable_genes function issued a warning and produced an odd result: image And the warning only happend in PC which error.

highly_variable_genes.py:78: RuntimeWarning: invalid value encountered in divide
  df['dispersions_norm'] = (

The version info of PC which not error

-----
anndata     0.9.2
scanpy      1.9.6
-----
Bio                 1.83
PIL                 10.3.0
annoy               NA
asciitree           NA
asttokens           NA
backcall            0.2.0
bleach              6.1.0
bokeh               2.4.3
certifi             2024.06.02
cffi                1.16.0
charset_normalizer  3.3.2
click               8.1.7
cloudpickle         3.0.0
colorcet            3.1.0
comm                0.2.1
cv2                 4.8.0
cycler              0.12.1
cython_runtime      NA
cytoolz             0.12.3
dask                2023.5.0
dask_image          2023.03.0
datashader          0.15.2
datashape           0.5.2
dateutil            2.9.0.post0
debugpy             1.6.7
decorator           5.1.1
dill                0.3.8
distributed         2023.5.0
docrep              0.3.2
dynamo              1.4.0
executing           0.8.3
fasteners           0.19
fbpca               NA
fsspec              2024.6.0
gefpy               1.1.3
geosketch           1.2
get_annotations     NA
google              NA
gtfparse            1.2.1
h5py                3.8.0
holoviews           1.17.1
hotspot             1.1.1
htmlparser          NA
hvplot              0.10.0
idna                3.7
igraph              0.10.8
imagecodecs         2023.3.16
imageio             2.31.1
importlib_resources NA
intervaltree        NA
ipykernel           6.28.0
ipywidgets          8.1.3
jedi                0.18.1
jinja2              3.1.4
joblib              1.4.2
jupyter_bokeh       3.0.5
kiwisolver          1.4.5
lazy_loader         0.4
leidenalg           0.10.2
llvmlite            0.39.1
locket              NA
loompy              3.0.7
louvain             0.8.0
lz4                 4.3.3
markdown            3.6
markupsafe          2.1.5
matplotlib          3.7.1
matplotlib_inline   0.1.6
matplotlib_scalebar 0.8.1
mpl_toolkits        NA
msgpack             1.0.8
multipledispatch    0.6.0
natsort             7.1.1
networkx            3.1
numba               0.56.4
numcodecs           0.12.1
numdifftools        0.9.41
numexpr             2.8.6
numpy               1.23.5
numpy_groupies      0.9.22
packaging           23.2
pandas              1.5.3
panel               0.14.4
param               1.13.0
parso               0.8.3
patsy               0.5.6
pexpect             4.8.0
phenograph          1.5.7
pickleshare         0.7.5
pkg_resources       NA
platformdirs        3.10.0
plotly              5.22.0
pooch               v1.8.2
prompt_toolkit      3.0.43
psutil              5.9.0
ptyprocess          0.7.0
pure_eval           0.2.2
pyarrow             16.1.0
pycirclize          1.6.0
pycparser           2.22
pyct                0.5.0
pydev_ipython       NA
pydevconsole        NA
pydevd              2.9.5
pydevd_file_utils   NA
pydevd_plugins      NA
pydevd_tracing      NA
pygments            2.15.1
pynndescent         0.5.12
pyparsing           3.1.2
pyscenic            0.12.1
pytz                2024.1
pyviz_comms         3.0.2
pywt                1.4.1
requests            2.32.3
retrying            NA
scanorama           1.7.4
scipy               1.10.1
seaborn             0.12.2
session_info        1.0.0
setuptools          68.2.2
shapely             2.0.4
six                 1.16.0
skimage             0.21.0
sklearn             1.3.0
sortedcontainers    2.4.0
spatialpandas       0.4.9
sphinxcontrib       NA
sqlalchemy          1.3.24
squidpy             1.2.2
stack_data          0.2.0
statsmodels         0.14.1
stereo              1.3.0
tblib               3.0.0
texttable           1.7.0
threadpoolctl       3.5.0
tifffile            2023.2.3
tlz                 0.12.3
toolz               0.12.1
torch               2.3.1+cu121
torchgen            NA
tornado             6.3.3
tqdm                4.65.0
traitlets           5.7.1
typing_extensions   NA
umap                0.5.1
urllib3             2.1.0
validators          0.28.3
vscode              NA
wcwidth             0.2.5
webencodings        0.5.1
xarray              0.20.1
yaml                6.0.1
zarr                2.16.1
zict                3.0.0
zipp                NA
zmq                 25.1.2
-----
IPython             8.12.2
jupyter_client      8.6.0
jupyter_core        5.5.0
-----
Python 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0]
Linux-6.1.0-21-amd64-x86_64-with-glibc2.17
-----
Session information updated at 2024-06-17 21:58

The version info of PC which error

-----
anndata     0.9.2
scanpy      1.9.6
-----
PIL                 10.3.0
annoy               NA
asciitree           NA
asttokens           NA
backcall            0.2.0
cffi                1.16.0
cloudpickle         3.0.0
colorcet            3.1.0
comm                0.2.1
cycler              0.12.1
cython_runtime      NA
cytoolz             0.12.3
dask                2023.5.0
dateutil            2.9.0.post0
debugpy             1.6.7
decorator           5.1.1
executing           0.8.3
fasteners           0.19
fbpca               NA
gefpy               1.1.3
get_annotations     NA
h5py                3.8.0
igraph              0.10.8
importlib_resources NA
intervaltree        NA
ipykernel           6.28.0
ipywidgets          8.1.3
jedi                0.18.1
jinja2              3.1.4
joblib              1.4.2
kiwisolver          1.4.5
leidenalg           0.10.2
llvmlite            0.39.1
louvain             0.8.0
lz4                 4.3.3
markupsafe          2.1.5
matplotlib          3.7.1
mpl_toolkits        NA
msgpack             1.0.8
natsort             7.1.1
numba               0.56.4
numcodecs           0.12.1
numexpr             2.8.6
numpy               1.23.5
packaging           23.2
pandas              1.5.3
parso               0.8.3
patsy               0.5.6
pexpect             4.8.0
pickleshare         0.7.5
pkg_resources       NA
platformdirs        3.10.0
plotly              5.22.0
prompt_toolkit      3.0.43
psutil              5.9.0
ptyprocess          0.7.0
pure_eval           0.2.2
pyarrow             16.1.0
pydev_ipython       NA
pydevconsole        NA
pydevd              2.9.5
pydevd_file_utils   NA
pydevd_plugins      NA
pydevd_tracing      NA
pygments            2.15.1
pyparsing           3.1.2
pytz                2024.1
scanorama           1.7.4
scipy               1.10.1
seaborn             0.12.2
session_info        1.0.0
setuptools          68.2.2
shapely             2.0.4
six                 1.16.0
sklearn             1.3.0
sortedcontainers    2.4.0
sphinxcontrib       NA
stack_data          0.2.0
statsmodels         0.14.1
stereo              1.3.0
tblib               3.0.0
texttable           1.7.0
threadpoolctl       3.5.0
tlz                 0.12.3
toolz               0.12.1
tornado             6.3.3
traitlets           5.14.3
typing_extensions   NA
wcwidth             0.2.5
yaml                6.0.1
zarr                2.16.1
zipp                NA
zmq                 25.1.2
-----
IPython             8.12.2
jupyter_client      8.6.0
jupyter_core        5.5.0
-----
Python 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0]
Linux-4.15.0-193-generic-x86_64-with-glibc2.17
-----
Session information updated at 2024-06-17 22:27
tanliwei-genomics-cn commented 2 weeks ago

What type is your data file? gef,gem or h5ad?

liuxiawei commented 2 weeks ago

Thanks for response, gef fle

tanliwei-genomics-cn commented 2 weeks ago

Thanks for response, gef fle

OK! I see that the version of your gefpy is 1.1.3, gefpy is used to load gef file, this version has a bug that causes the error you met, I think your stereopy is not latest, upgrade to 1.3.0.

liuxiawei commented 2 weeks ago

I guess it not the problem of version if gefpy or stereopy. I upgrade gefpy to 1.1.8 while the stereopy is already 1.3.0. But the problem is still existed

tanliwei-genomics-cn commented 2 weeks ago

Print the data.cells respectively after data.tl.cal_qc() to check whether the data is correct.