-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi, thanks for sharing the package. it sounds amazing.
However, I encountered some problems while using the algorithm from website but also from python environment.
First, I tried both my own dataset and the demo H5ad files, it gives the same type of errors below, do you know why? I also pasted the error log below. it looks like there is a problem of dependency of skilearn, could you provide me which version of skilearn you used in STCAT.
Also, I would like to now, which codes did you use to generate raw matrix in txt and H5ad, I have also tried my own H5ad and txt files from my own project which did not work using your package, but it was ok using other packages like Celltypist or Azimuth, do you have any idea and could you share me this important parameters?
Great thanks !
🧮 T cell number : 2977
🧮 None T cell number : 0
💬 The input file seems not a raw count matrix.
✔ All genes and log1p normalized expression to 10000 counts per cell.
AttributeError Traceback (most recent call last)
File ~/anaconda3/envs/STCAT/lib/python3.9/site-packages/STCAT/models.py:58, in Model.load(model)
57 try:
---> 58 pkl_obj = pickle.load(fh)
59 return Model(pkl_obj['Model'], pkl_obj['Scaler_'], pkl_obj['description'])
AttributeError: Can't get attribute 'Log' on <module 'sklearn.linear_model._sgd_fast' from '/Users/zhicheng/anaconda3/envs/STCAT/lib/python3.9/site-packages/sklearn/linear_model/_sgd_fast.cpython-39-darwin.so'>
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
Cell In[5], line 1
----> 1 results = STCAT.STCAT(adata)
File ~/anaconda3/envs/STCAT/lib/python3.9/site-packages/STCAT/STCAT.py:59, in STCAT(adata)
57 np.random.seed(0)
58 model = os.path.join(data_path, 'T_cell.pkl')
---> 59 predictions_voting = annotate.annotate(adata_T, model = model, majority_voting = True, min_prop =0.3)
60 df = predictions_voting.predicted_labels.rename(columns={'predicted_labels': 'predicted_labels_'+ str(0), 'over_clustering': 'over_clustering_' + str(0), 'majority_voting': 'majority_voting_'+ str(0)})
61 df = df.reindex(adata_T.obs_names)
File ~/anaconda3/envs/STCAT/lib/python3.9/site-packages/STCAT/annotate.py:77, in annotate(filename, model, transpose_input, gene_file, cell_file, mode, p_thres, majority_voting, over_clustering, min_prop)
19 """
20 Run the prediction and (optional) majority voting to annotate the input dataset.
21
(...)
74 4) :attr:~celltypist.classifier.AnnotationResult.adata, AnnData representation of the input data.
75 """
76 #load model
---> 77 lr_classifier = model if isinstance(model, Model) else Model.load(model)
78 #construct Classifier class
79 clf = classifier.Classifier(filename = filename, model = lr_classifier, transpose = transpose_input, gene_file = gene_file, cell_file = cell_file)
File ~/anaconda3/envs/STCAT/lib/python3.9/site-packages/STCAT/models.py:61, in Model.load(model)
59 return Model(pkl_obj['Model'], pkl_obj['Scaler_'], pkl_obj['description'])
60 except Exception as exception:
---> 61 raise Exception(
62 f"🛑 Invalid model: {model}. {exception}")
Exception: 🛑 Invalid model: /Users/anaconda3/envs/STCAT/lib/python3.9/site-packages/STCAT/data/T_cell.pkl. Can't get attribute 'Log' on <module 'sklearn.linear_model._sgd_fast' from '/Users/anaconda3/envs/STCAT/lib/python3.9/site-packages/sklearn/linear_model/_sgd_fast.cpython-39-darwin.so'>