DerKevinRiehl / transposon_classifier_rfsb

Transposon classification tools RFSB, part of TransposonUltimate
GNU General Public License v3.0
13 stars 4 forks source link

Scikit-learn version issue when installing the package with conda #6

Open Jiseon623 opened 8 months ago

Jiseon623 commented 8 months ago

Thank you for creating such an excellent tool. It has been very helpful for my work.

I have experienced some difficulty in using the tool, and I would like to request a slight modification.

I followed the instructions in the README file to install the package and run mode 1 with default option. However, an error occurred. I identified the issue as a problem with the scikit-learn version, and I was able to resolve it by using the following code:

conda create -n TransposonClassifier_rfsb python==3.10
mamba install -c derkevinriehl -c bioconda transposon_classifier_rfsb scikit-learn==1.2.2

The error message is as follows:

Traceback (most recent call last):
  File "~/.conda/envs/TransposonClassifier_rfsb/share/TransposonClassifierRFSB1.0.0/RFSB_TE_Classifier.py", line 200, in <module>
    classifyTransposons(tempFileA, tempFileC, dbFile, modelFile, fastaFile, outputFile)
  File "~/.conda/envs/TransposonClassifier_rfsb/share/TransposonClassifierRFSB1.0.0/RFSB_ModelManager.py", line 255, in classifyTransposons
    models =  pickle.load(file)#["model"]
              ^^^^^^^^^^^^^^^^^
  File "sklearn/tree/_tree.pyx", line 714, in sklearn.tree._tree.Tree.__setstate__
  File "sklearn/tree/_tree.pyx", line 1418, in sklearn.tree._tree._check_node_ndarray
ValueError: node array from the pickle has an incompatible dtype:
- expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, 16, 24, 32, 40, 48, 56], 'itemsize': 64}
- got     : [('left_child', '<i8'), ('right_child', '<i8'), ('feature', '<i8'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')]

Thank you for your time

DerKevinRiehl commented 8 months ago

Dear Jiseon623, thank you for this helpful remark! I will add it to the documentation and installation instructions.

Best regards, Kevin