Infercnvpy cnv_score-Funktion AttributeError: Das Objekt „Series“ hat kein Attribut „ungleich Null“.

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Infercnvpy cnv_score-Funktion AttributeError: Das Objekt „Series“ hat kein Attribut „ungleich Null“.

by Guest » 17 Jan 2025, 09:34

Ich habe einige scRNA-seq-Daten von GSE214966 analysiert, als ich beim Ausführen der Funktion cnv_score() aus dem Paket infercnvpy auf ein Problem stieß. Es löst ständig einen AttributeError aus: „Series“-Objekt hat kein Attribut „ungleich Null“.
Ich habe auch versucht, das Beispiel aus ihrem Website-Tutorial zu reproduzieren (https://infercnvpy.readthedocs.io/en). /latest/notebooks/tutorial_3k.html), aber es wird der gleiche Fehler ausgegeben. Das bedeutet wahrscheinlich, dass das Problem bei mir liegt, aber ich kann nicht herausfinden, was falsch ist.
Ich habe versucht, alle Pakete und auch Python neu zu installieren, aber es hat nichts geklappt. Der Fehler deutet darauf hin, dass das Problem darin besteht, dass Pandas.Series kein Attribut wie ungleich Null hat, was nicht der Fall ist. Aber dann weiß ich nicht, was falsch ist oder wie ich dieses Problem lösen kann, da es sich um eine Funktion aus einem Paket handelt.
Kann mir jemand dabei helfen?
Fehlerbeschreibung

Code: Select all

AttributeError                            Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_9248\2255080222.py in ?()
1 import infercnvpy as cnv
----> 2 cnv.tl.cnv_score(adata, groupby="leiden")

d:\Datos de usuario\Desktop\Single Cell Analysis\Glioblastoma (GSE214966)\Glioblastoma-GSE214966\.venv\Lib\site-packages\infercnvpy\tl\_scores.py in ?(adata, groupby, use_rep, key_added, inplace, obs_key)
61         groupby = obs_key
62
63     if groupby not in adata.obs.columns and groupby == "cnv_leiden":
64         raise ValueError("`cnv_leiden` not found in `adata.obs`. Did you run `tl.leiden`?")
---> 65     cluster_score = {
66         cluster: np.mean(np.abs(adata.obsm[f"X_{use_rep}"][adata.obs[groupby] == cluster, :]))
67         for cluster in adata.obs[groupby].unique()
68     }

d:\Datos de usuario\Desktop\Single Cell Analysis\Glioblastoma (GSE214966)\Glioblastoma-GSE214966\.venv\Lib\site-packages\scipy\sparse\_index.py in ?(self, key)
29     def __getitem__(self, key):
---> 30         index, new_shape = self._validate_indices(key)
31
32         # 1D array
33         if len(index) == 1:

d:\Datos de usuario\Desktop\Single Cell Analysis\Glioblastoma (GSE214966)\Glioblastoma-GSE214966\.venv\Lib\site-packages\scipy\sparse\_index.py in ?(self, key)
265                 if ix.shape != mid_shape:
266                     raise IndexError(
267                         f"bool index {i} has shape {mid_shape} instead of {ix.shape}"
268                     )
--> 269                 index.extend(ix.nonzero())
270                 array_indices.extend(range(index_ndim, tmp_ndim))
271                 index_ndim = tmp_ndim
272             else:  # dense array

d:\Datos de usuario\Desktop\Single Cell Analysis\Glioblastoma (GSE214966)\Glioblastoma-GSE214966\.venv\Lib\site-packages\pandas\core\generic.py in ?(self, name)
6295             and name not in self._accessors
6296             and self._info_axis._can_hold_identifiers_and_holds_name(name)
6297         ):
6298             return self[name]
-> 6299         return object.__getattribute__(self, name)

AttributeError: 'Series' object has no attribute 'nonzero'
Session_info

Code: Select all

-----
anndata             0.11.3
infercnvpy          0.5.0
matplotlib          3.10.0
numpy               1.26.4
openpyxl            3.1.5
pandas              2.2.3
scanpy              1.10.4
scipy               1.15.1
session_info        1.0.0
sklearn             1.6.1
-----
PIL                 11.1.0
asttokens           NA
attr                24.3.0
attrs               24.3.0
cairo               1.27.0
cattr               NA
cattrs              NA
certifi             2024.12.14
charset_normalizer  3.4.1
colorama            0.4.6
comm                0.2.2
cycler              0.12.1
...
Python 3.12.6 (tags/v3.12.6:a4a2d2b, Sep  6 2024, 20:11:23) [MSC v.1940 64 bit (AMD64)]
Windows-10-10.0.19045-SP0
-----
Session information updated at 2025-01-16 16:27

Top