scverse / pertpy

Perturbation Analysis in the scverse ecosystem.
https://pertpy.readthedocs.io/en/latest/
MIT License
92 stars 19 forks source link

Error while using ms.mixscape - ValueError: Input X contains NaN. #617

Open VittoriaDBocchi opened 1 month ago

VittoriaDBocchi commented 1 month ago

Report

Hi! Thank you for developing this tool it is very helpful! I am using mixscape to analyze my perturb-seq data. However when I arrive here ms.mixscape(adata=mdata["rna"], control="sg_non_targeting", labels="GuidesGene",layer="X_pert")

I initally get this warning s.py:429: PerformanceWarning: DataFrame is highly fragmented. This is usually the result of calling frame.insert many times, which has poor performance. Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use newframe = frame.copy() self.stats[group_name, "names"] = self.var_names[global_indices]

and then get this error:

ValueError: Input X contains NaN. GaussianMixture does not accept missing values encoded as NaN natively. For supervised learning, you might want to consider sklearn.ensemble.HistGradientBoostingClassifier and Regressor which accept missing values encoded as NaNs natively. Alternatively, it is possible to preprocess the data, for instance by using an imputer transformer in a pipeline or drop samples with missing values. See https://scikit-learn.org/stable/modules/impute.html You can find a list of all estimators that handle NaN values at the following page: https://scikit-learn.org/stable/modules/impute.html#estimators-that-handle-nan-values

I checked and I do not have NA values in X. Any suggestions on how to solve this? Thanks for your help Vittoria

Version information


anndata 0.10.7 matplotlib 3.8.4 mudata 0.2.3 muon 0.1.6 numpy 1.26.4 pandas 2.2.2 pertpy 0.7.0 scanpy 1.10.1 scipy 1.13.0 seaborn 0.13.2 session_info 1.0.0

PIL 10.3.0 absl NA adjustText 1.1.1 arrow 1.3.0 arviz 0.18.0 asttokens NA attr 23.2.0 backcall 0.2.0 blitzgsea NA certifi 2024.02.02 chardet 5.2.0 charset_normalizer 3.3.2 chex 0.1.86 colorama 0.4.6 comm 0.1.2 contextlib2 NA custom_inherit 2.4.1 cycler 0.12.1 cython_runtime NA dateutil 2.8.2 debugpy 1.6.7 decorator 5.1.1 decoupler 1.6.0 docrep 0.3.2 etils 1.8.0 executing 0.8.3 flax 0.8.3 fsspec 2024.3.1 h5py 3.11.0 idna 3.7 igraph 0.11.5 importlib_resources NA ipykernel 6.25.0 jax 0.4.27 jaxlib 0.4.27 jaxopt NA jedi 0.18.1 joblib 1.4.2 kiwisolver 1.4.5 legacy_api_wrap NA leidenalg 0.10.2 lightning 2.1.4 lightning_fabric 2.2.4 lightning_utilities 0.11.2 llvmlite 0.42.0 matplotlib_inline 0.1.6 ml_collections NA ml_dtypes 0.4.0 mpl_toolkits NA mpmath 1.3.0 msgpack 1.0.8 multipledispatch 0.6.0 natsort 8.4.0 numba 0.59.1 numpyro 0.14.0 opt_einsum v3.3.0 optax 0.2.2 ott 0.4.6 packaging 23.1 parso 0.8.3 patsy 0.5.6 pexpect 4.8.0 pickleshare 0.7.5 pkg_resources NA platformdirs 3.10.0 ply 3.11 png 0.20220715.0 pretty_errors 1.2.25 prompt_toolkit 3.0.36 psutil 5.9.0 ptyprocess 0.7.0 pubchempy 1.0.4 pure_eval 0.2.2 pyarrow 16.0.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 pyomo 6.7.1 pyparsing 3.1.2 pyro 1.9.0 pytorch_lightning 2.2.4 pytz 2024.1 reportlab 4.2.0 requests 2.31.0 rich NA scvi 1.1.2 six 1.16.0 sklearn 1.4.2 skmisc 0.3.1 sparsecca 0.3.1 stack_data 0.2.0 statsmodels 0.14.2 texttable 1.7.0 threadpoolctl 3.5.0 toolz 0.12.1 torch 2.3.0+cu121 torchgen NA torchmetrics 1.4.0 tornado 6.3.3 toyplot 1.0.3 toytree 2.0.5 tqdm 4.66.4 traitlets 5.7.1 tree 0.1.8 typing_extensions NA umap 0.5.6 urllib3 2.2.1 wcwidth 0.2.5 xarray 2024.3.0 xarray_einstats 0.7.0 yaml 6.0.1 zmq 25.1.0

IPython 8.15.0 jupyter_client 8.6.0 jupyter_core 5.5.0

Python 3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0] Linux-3.10.0-1160.45.1.el7.x86_64-x86_64-with-glibc2.17

Session information updated at 2024-05-28 16:08

Zethson commented 1 month ago

Hi,

without looking at your dataset I can only make wild guesses. Is there a way for you to share it?

Cheers

VittoriaDBocchi commented 1 week ago

Hi Lucas, I am so SORRY but this email ended up in the spam not sure why! Can I still send you the data? Again I am so sorry Thank you so much for your help. All the best, Vittoria


From: Lukas Heumos @.> Sent: 29 May 2024 09:23 To: theislab/pertpy @.> Cc: Bocchi, Vittoria @.>; Author @.> Subject: [EXTERNAL] Re: [theislab/pertpy] Error while using ms.mixscape - ValueError: Input X contains NaN. (Issue #617)

Hi, without looking at your dataset I can only make wild guesses. Is there a way for you to share it? Cheers — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread. Message

Hi,

without looking at your dataset I can only make wild guesses. Is there a way for you to share it?

Cheers

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/theislab/pertpy/issues/617*issuecomment-2136714495__;Iw!!KVWo1iE!SEkJA4_1VUBYVU2fq5jqNuxzpRkY14Ld3EhjijQ8ANe_Pk9o6wSZRIvY7JVgv6BiVbAalLy36iDfhOKlgY5hhAI$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A4WYJRRSNZ3OFKDLSZSA67DZEV7A7AVCNFSM6AAAAABINTCNUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZWG4YTINBZGU__;!!KVWo1iE!SEkJA4_1VUBYVU2fq5jqNuxzpRkY14Ld3EhjijQ8ANe_Pk9o6wSZRIvY7JVgv6BiVbAalLy36iDfhOKllHmrf1k$. You are receiving this because you authored the thread.Message ID: @.***>

=====================================================================

Please note that this e-mail and any files transmitted from Memorial Sloan Kettering Cancer Center may be privileged, confidential, and protected from disclosure under applicable law. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this communication or any of its attachments is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and deleting this message, any attachments, and all copies and backups from your computer.

Disclaimer ID:MSKCC

Zethson commented 1 week ago

Yes of course!

VittoriaDBocchi commented 1 week ago

Thank you so much!!! I will send via the box between today and tomorrow.. Thank you again for your help I really appreciate it! Vittoria


From: Lukas Heumos @.> Sent: 18 June 2024 21:10 To: scverse/pertpy @.> Cc: Bocchi, Vittoria @.>; Author @.> Subject: [EXTERNAL] Re: [scverse/pertpy] Error while using ms.mixscape - ValueError: Input X contains NaN. (Issue #617)

Yes of course! — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread. Message ID: scverse/pertpy/issues/617/2176781480@ github. com ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍

Yes of course!

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/scverse/pertpy/issues/617*issuecomment-2176781480__;Iw!!KVWo1iE!WbZNl5kJQoDaYWNeZ0PW_vy8Qd4oxp-cyTTwF-MfNf3EUtg0CkKnv2sAWUg6p96XYPu1a4t8X6HDQZ8_xB0Z06o$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A4WYJRTRLTIG3HDJ4ADDCF3ZICA2JAVCNFSM6AAAAABINTCNUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZWG44DCNBYGA__;!!KVWo1iE!WbZNl5kJQoDaYWNeZ0PW_vy8Qd4oxp-cyTTwF-MfNf3EUtg0CkKnv2sAWUg6p96XYPu1a4t8X6HDQZ8_8pvHqnQ$. You are receiving this because you authored the thread.Message ID: @.***>

=====================================================================

Please note that this e-mail and any files transmitted from Memorial Sloan Kettering Cancer Center may be privileged, confidential, and protected from disclosure under applicable law. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this communication or any of its attachments is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and deleting this message, any attachments, and all copies and backups from your computer.

Disclaimer ID:MSKCC