Closed pakiessling closed 6 months ago
Hi again! Thanks for posting.
I managed to trigger this error with nans and infs in .X or .obs:
# import packages
import tacco as tc
import anndata as ad
import numpy as np
import pandas as pd
# setup test case
X = np.diag([1.0]*5)
#X[0,0] = np.nan # setting one element in .X to nan gives that error
#X[0,0] = np.inf # setting one element in .X to inf gives that error
adata = ad.AnnData(X)
adata.obs['ct'] = pd.Series(['A','A','B','B','C'],index=adata.obs.index).astype(pd.CategoricalDtype(['A','B','C']))
#adata.obs['ct'] = adata.obs['ct'].astype(pd.CategoricalDtype(['A','B'])) # provoking an nan in the celltype annotation also gives that error
# trigger the error
tc.tl.annotate(adata,adata,annotation_key='ct',result_key="tacco")
Can you check whether one of them happens in your input?
If these issues are not present in your input, could you try creating a minimal non-working example, like the one above? That should help you find issues with the input and me investigating possible bugs in the code.
Huh, it seems to work now. Not sure what the problem was. Probably an NA in annotation or something. Sorry about that.
Hi,
I am trying to annotate a dataset like this:
I get the following error:
I previoulsy annotated other datasets succesfully. I also used the novosparc method for this reference and dataset and it completed with a warning:
I made sure that both dataset have positive integers and no NaNs. Any ideas what is going wrong?