scverse / scanpy

Single-cell analysis in Python. Scales to >1M cells.
https://scanpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.92k stars 598 forks source link

A bug about scanpy.pp.downsample_counts() #1368

Closed AllenWu18 closed 1 year ago

AllenWu18 commented 4 years ago

Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

I just use the function sc.pp.downsample_counts() to downsample the data, but after that I can't see any output from the Spyder IPython console.

Minimal code sample (that we can copy&paste without having any data)

# Your code here

import numpy as np import scanpy as sc import h5py

data = h5py.File('10X_PBMC.h5')

x = np.array(data['X']) adata = sc.AnnData(x)

sc.pp.downsample_counts(adata, counts_per_cell=1000)

[Paste the error output produced by the above code here]

after I run the above code, there isn;t any error. But when I key in 'adata' or any other thing in the Spyder IPython console, it just shows:

/anaconda3/lib/python3.7/site-packages/ipykernel/ipkernel.py:448: DeprecationWarning: input_splitter is deprecated since IPython 7.0, prefer input_transformer_manager. status, indent_spaces = self.shell.input_splitter.check_complete(code)

and there is nothing about the output I want. After that, my console can’t output anything, unless I exit Spyder and re-enter.

Versions

Python 3.7.0 Scanpy 1.4.3

[Paste the output of scanpy.logging.print_versions() leaving a blank line after the details tag] scanpy==1.4.3 anndata==0.6.19 umap==0.3.10 numpy==1.14.6 scipy==1.1.0 pandas==0.23.4 scikit-learn==0.20.1 statsmodels==0.9.0 python-igraph==0.7.1 louvain==0.6.1
ivirshup commented 4 years ago

At first blush, this looks like an issue with spyder. I'd suggest trying to update your versions of installed packages (it looks like your scanpy and anndata are out of date) and trying again. If that fails, can you replicate in a different python environment?

eroell commented 1 year ago

As we haven't heard back after the follow-up we will close the issue for now, hopefully you obtained the expected behaviour in the end :)

However, please don't hesitate to reopen this issue or create a new one if you have any more questions or run into any related problems in the future.

Thanks for being a part of our community! :)