Closed rodrisenovilla closed 2 years ago
I had the same problem. To solve it, I defined the transfer_annotation function in my local jupyter notebook, which is the same as the transfer_annotation function in https://github.com/atarashansky/SAMap/blob/main/samap/analysis.py After this, the local function transfer_annotation works. Hope this helps.
Thank you for teh suggestion! Same error, don't get why... I believe it must be because SAMap cannot find the annotation in the object, so that is why "tissue" is not found... But don't know how to solve it
First of all, thanks for the tool, it is pretty cool! I could install samap and re-run all the vignette finely, but when I tried to transfer the annotations from one object to the integrated object, this panda-related error appeared. I have tried with the docker version, in case it was an installation issue, but it crashed too. With my own data, same error...
This is the input:
table=transfer_annotations(sm,reference_id='sc',keys='tissue')
This is the error message it sends:
KeyError Traceback (most recent call last) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3620 try: -> 3621 return self._engine.get_loc(casted_key) 3622 except KeyError as err:
~/.local/lib/python3.8/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
~/.local/lib/python3.8/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'tissue'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)