Skip to content
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

ValueError: Output dtype not compatible with inputs. #3331

Open
2 of 3 tasks
ianfd opened this issue Oct 30, 2024 · 1 comment
Open
2 of 3 tasks

ValueError: Output dtype not compatible with inputs. #3331

ianfd opened this issue Oct 30, 2024 · 1 comment
Labels
Bug 🐛 Triage 🩺 This issue needs to be triaged by a maintainer

Comments

@ianfd
Copy link

ianfd commented Oct 30, 2024

Please make sure these conditions are met

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of scanpy.
  • (optional) I have confirmed this bug exists on the main branch of scanpy.

What happened?

When we tried to compute QC metrics for our dataset we got this error (see title). Produced by the X.eliminate_zeros() call.

We also traced the error back to genes that have only zeros in them, which would remove these columns and thus change the shape of the matrix. When we removed these genes the error vanished and the program ran successfully.

Minimal code sample

sc.pp.calculate_qc_metrics(
raw_data, qc_vars=["mt", "ribo", "hb"], inplace=True, log1p=True
)

Error output

No response

Versions

-----
anndata     0.10.9
scanpy      1.10.3
-----
PIL                 10.4.0
asttokens           NA
charset_normalizer  3.4.0
colorama            0.4.6
comm                0.2.2
cycler              0.12.1
cython_runtime      NA
dateutil            2.9.0
debugpy             1.8.5
decorator           5.1.1
executing           2.1.0
h5py                3.11.0
ipykernel           6.29.5
jedi                0.19.1
joblib              1.4.2
kiwisolver          1.4.7
legacy_api_wrap     NA
llvmlite            0.43.0
matplotlib          3.9.2
matplotlib_inline   0.1.7
mpl_toolkits        NA
natsort             8.4.0
numba               0.60.0
numpy               2.0.2
packaging           24.1
pandas              2.2.3
parso               0.8.4
pickleshare         0.7.5
platformdirs        4.3.6
prompt_toolkit      3.0.47
psutil              6.0.0
pure_eval           0.2.3
pydev_ipython       NA
pydevconsole        NA
pydevd              2.9.5
pydevd_file_utils   NA
pydevd_plugins      NA
pydevd_tracing      NA
pygments            2.18.0
pyparsing           3.1.4
pytz                2024.1
scipy               1.14.1
session_info        1.0.0
six                 1.16.0
sklearn             1.5.2
stack_data          0.6.2
threadpoolctl       3.5.0
tornado             6.4.1
traitlets           5.14.3
vscode              NA
wcwidth             0.2.13
yaml                6.0.2
zmq                 26.2.0
-----
IPython             8.27.0
jupyter_client      8.6.3
jupyter_core        5.7.2
-----
Python 3.12.6 | packaged by conda-forge | (main, Sep 22 2024, 14:16:49) [GCC 13.3.0]
Linux-5.15.0-122-generic-x86_64-with-glibc2.35
-----
Session information updated at 2024-10-30 08:33

@ianfd ianfd added Bug 🐛 Triage 🩺 This issue needs to be triaged by a maintainer labels Oct 30, 2024
@Zethson
Copy link
Member

Zethson commented Oct 30, 2024

Could you please post the full stacktrace and ideally provide us with a minimal working example to more easily find out what's going wrong? Can you create an artificial AnnData object that has the properties where the function fails? Can you create a subset of your data and then recreate an AnnData object that looks similar and leads to the issue?

LLMs can help you here.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Triage 🩺 This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants