jiarong / VirSorter2

customizable pipeline to identify viral sequences from (meta)genomic data
GNU General Public License v2.0
219 stars 30 forks source link

Error in rule classify_by_group: #190

Closed xjhzjucas closed 8 months ago

xjhzjucas commented 8 months ago

Hi jiarong: Thank you for develping this nice tool. I met a error, could you help me for that? My commond is like: virsorter run --keep-original-seq -i 5seq.fa -w vs2-pass1 --include-groups dsDNAphage,ssDNA --min-length 5000 --min-score 0.5 -j 28 all It turned error like:

[2024-02-23 12:10 INFO] # of seqs < 5000 bp and removed: 40230
[2024-02-23 12:10 INFO] # of circular seqs: 500
[2024-02-23 12:10 INFO] # of linear seqs  : 729
[2024-02-23 12:10 INFO] Finish spliting linear contig file with common rbs
[2024-02-23 12:10 INFO] Finish spliting circular contig file with common rbs
[2024-02-23 12:11 INFO] Step 1 - preprocess finished.
[2024-02-23 12:48 INFO] Step 2 - extract-feature finished.
[2024-02-23 12:48 ERROR] See error details in /mnt/sdb/xjh/proj_vlp_bulk/vlp_assembly_virsorter2/HE-1/vs2-pass1/log/iter-0/step3-classify/all-score-ssDNA.log
[Fri Feb 23 12:48:38 2024]
Error in rule classify_by_group:
    jobid: 57
    output: iter-0/ssDNA/all.pdg.clf
    conda-env: /mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b
    shell:

        Log=/mnt/sdb/xjh/proj_vlp_bulk/vlp_assembly_virsorter2/HE-1/vs2-pass1/log/iter-0/step3-classify/all-score-ssDNA.log
        python /mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py iter-0/ssDNA/all.pdg.ftr /mnt/sdb/xjh/software/viral-id-sop/db-vs2/group/ssDNA/model ssDNA iter-0/ssDNA/all.pdg.clf 2> $Log || { echo "See error details in $Log" | python /mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/echo.py --level error; exit 1; }

        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

[2024-02-23 12:48 ERROR] See error details in /mnt/sdb/xjh/proj_vlp_bulk/vlp_assembly_virsorter2/HE-1/vs2-pass1/log/iter-0/step3-classify/all-score-dsDNAphage.log
[Fri Feb 23 12:48:38 2024]
Error in rule classify_by_group:
    jobid: 56
    output: iter-0/dsDNAphage/all.pdg.clf
    conda-env: /mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b
    shell:

        Log=/mnt/sdb/xjh/proj_vlp_bulk/vlp_assembly_virsorter2/HE-1/vs2-pass1/log/iter-0/step3-classify/all-score-dsDNAphage.log
        python /mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py iter-0/dsDNAphage/all.pdg.ftr /mnt/sdb/xjh/software/viral-id-sop/db-vs2/group/dsDNAphage/model dsDNAphage iter-0/dsDNAphage/all.pdg.clf 2> $Log || { echo "See error details in $Log" | python /mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/echo.py --level error; exit 1; }

        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Exiting because a job execution failed. Look above for error message

I don't know how to deal with it. Thanks!

jiarong commented 8 months ago

Hi, you paste the error message in /mnt/sdb/xjh/proj_vlp_bulk/vlp_assembly_virsorter2/HE-1/vs2-pass1/log/iter-0/step3-classify/all-score-dsDNAphage.log?

jiarong commented 8 months ago

Never mind. I saw your emails w/ the error message. You have somehow set python to use packages installed in /mnt/sdb/xjh/.local/ instead of VirSorter2. You can 1) change that setting, or 2) use the singularity / apptainer version to avoid this problem.

xjhzjucas commented 8 months ago

Thank you for your help! I'll try to work it out according to your suggestions. And I'm also confused about what's the functions of the /db-vs2/conda_envs/5346076b/, since it was found in my /step3-classify/all-score-ssDNA.log and /step3-classify/all-score-ssDNA.log:

Traceback (most recent call last):
  File "/mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py", line 77, in <module>
    main()
  File "/mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py", line 60, in main
    model = joblib.load(model_f)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 658, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle
    obj = unpickler.load()
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1212, in load
    dispatch[key[0]](self)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1537, in load_stack_global
    self.append(self.find_class(module, name))
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1579, in find_class
    __import__(module, level=0)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/ensemble/__init__.py", line 7, in <module>
    from ._forest import RandomForestClassifier
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/ensemble/_forest.py", line 56, in <module>
    from ..tree import (DecisionTreeClassifier, DecisionTreeRegressor,
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/tree/__init__.py", line 6, in <module>
    from ._classes import BaseDecisionTree
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/tree/_classes.py", line 40, in <module>
    from ._criterion import Criterion
  File "sklearn/tree/_splitter.pxd", line 34, in init sklearn.tree._criterion
  File "sklearn/tree/_tree.pxd", line 37, in init sklearn.tree._splitter
  File "sklearn/neighbors/_quad_tree.pxd", line 55, in init sklearn.tree._tree
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/neighbors/__init__.py", line 17, in <module>
    from ._nca import NeighborhoodComponentsAnalysis
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/neighbors/_nca.py", line 22, in <module>
    from ..decomposition import PCA
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/__init__.py", line 17, in <module>
    from .dict_learning import dict_learning
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/dict_learning.py", line 4, in <module>
    from . import _dict_learning
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/_dict_learning.py", line 21, in <module>
    from ..linear_model import Lasso, orthogonal_mp_gram, LassoLars, Lars
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/linear_model/__init__.py", line 12, in <module>
    from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV,
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py", line 30, in <module>
    method='lar', copy_X=True, eps=np.finfo(np.float).eps,
  File "//mnt/sdb/xjh/.local/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

It looks like this process used 3 different python: 1./envs/suv_threesoft/lib/python3.10/; 2./db-vs2/conda_envs/5346076b/lib/python3.8/; 3./mnt/sdb/xjh/.local/lib/python3.8/ I don't know why this process used 3 python and how to avoid this (i.e. change that setting) Thanks!

hdflorezr commented 8 months ago

I'm also having the same issue, but I would like to know what is the path wich I should set from ./.local to Virsorter2. This is the printed error that I had: [2024-02-28 00:33 ERROR] See error details in /media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/work/1b/6c9dcbb09335b1d01611163e3b9fdb/SRR8653218_virsorter2/log/iter-0/step3-classify/all-score-ssDNA.log [Wed Feb 28 00:33:53 2024] Error in rule classify_by_group: jobid: 57 output: iter-0/ssDNA/all.pdg.clf conda-env: /media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/db/virsorter/virsorter2/conda_envs/f1f2e930 shell:

    Log=/media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/work/1b/6c9dcbb09335b1d01611163e3b9fdb/SRR8653218_virsorter2/log/iter-0/step3-classify/all-score-ssDNA.log
    python /home/omicas/miniconda3/envs/metaphage2/lib/python3.7/site-packages/virsorter/./scripts/classify.py iter-0/ssDNA/all.pdg.ftr /media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/db/virsorter/virsorter2/group/ssDNA/model ssDNA iter-0/ssDNA/all.pdg.clf 2> $Log || { echo "See error details in $Log" | python /home/omicas/miniconda3/envs/metaphage2/lib/python3.7/site-packages/virsorter/./scripts/echo.py --level error; exit 1; }

    (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

[2024-02-28 00:33 ERROR] See error details in /media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/work/1b/6c9dcbb09335b1d01611163e3b9fdb/SRR8653218_virsorter2/log/iter-0/step3-classify/all-score-dsDNAphage.log [Wed Feb 28 00:33:53 2024] Error in rule classify_by_group: jobid: 56 output: iter-0/dsDNAphage/all.pdg.clf conda-env: /media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/db/virsorter/virsorter2/conda_envs/f1f2e930 shell:

    Log=/media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/work/1b/6c9dcbb09335b1d01611163e3b9fdb/SRR8653218_virsorter2/log/iter-0/step3-classify/all-score-dsDNAphage.log
    python /home/omicas/miniconda3/envs/metaphage2/lib/python3.7/site-packages/virsorter/./scripts/classify.py iter-0/dsDNAphage/all.pdg.ftr /media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/db/virsorter/virsorter2/group/dsDNAphage/model dsDNAphage iter-0/dsDNAphage/all.pdg.clf 2> $Log || { echo "See error details in $Log" | python /home/omicas/miniconda3/envs/metaphage2/lib/python3.7/site-packages/virsorter/./scripts/echo.py --level error; exit 1; }

And the log file information is:File "/media/omicas/data/Datos_Hernan/MetaPhage/MetaPhage/db/virsorter/virsorter2/conda_envs/f1f2e930/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py", line 30, in method='lar', copy_X=True, eps=np.finfo(np.float).eps, File "/home/omicas/.local/lib/python3.8/site-packages/numpy/init.py", line 305, in getattr raise AttributeError(__former_attrs__[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Thans for your help.

jiarong commented 8 months ago

Hi, you could rename "/home/omicas/.local/ to something else to resolve this issue, but this might cause issues for other tools that depend on packages installed there.

xjhzjucas commented 8 months ago

Hi, you could rename "/home/omicas/.local/ to something else to resolve this issue, but this might cause issues for other tools that depend on packages installed there.

Hi jiarong, how about /db-vs2/conda_envs/5346076b/lib/python3.8/ in the vs2 downloaded database? Should I delete it to avoid the software make use of it?

jiarong commented 8 months ago

Hi, you could rename "/home/omicas/.local/ to something else to resolve this issue, but this might cause issues for other tools that depend on packages installed there.

Hi jiarong, how about /db-vs2/conda_envs/5346076b/lib/python3.8/ in the vs2 downloaded database? Should I delete it to avoid the software make use of it?

No. Generally, I recommend installation option 3 in this case for the reasons I have commented above.

hdflorezr commented 7 months ago

Hi, you could rename "/home/omicas/.local/ to something else to resolve this issue, but this might cause issues for other tools that depend on packages installed there.

Hi, jiarong, how could I do this? I was trying to rename the folder, even doing some changes in the path, but actually I couldn't fix the problem. Even, I changed the virsorter version from 2.2.3 to 2.2.4. I'm using v2 through metaphage.

Thank you.

2061574124 commented 4 months ago

Thank you for your help! I'll try to work it out according to your suggestions. And I'm also confused about what's the functions of the /db-vs2/conda_envs/5346076b/, since it was found in my /step3-classify/all-score-ssDNA.log and /step3-classify/all-score-ssDNA.log:

Traceback (most recent call last):
  File "/mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py", line 77, in <module>
    main()
  File "/mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py", line 60, in main
    model = joblib.load(model_f)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 658, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle
    obj = unpickler.load()
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1212, in load
    dispatch[key[0]](self)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1537, in load_stack_global
    self.append(self.find_class(module, name))
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1579, in find_class
    __import__(module, level=0)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/ensemble/__init__.py", line 7, in <module>
    from ._forest import RandomForestClassifier
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/ensemble/_forest.py", line 56, in <module>
    from ..tree import (DecisionTreeClassifier, DecisionTreeRegressor,
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/tree/__init__.py", line 6, in <module>
    from ._classes import BaseDecisionTree
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/tree/_classes.py", line 40, in <module>
    from ._criterion import Criterion
  File "sklearn/tree/_splitter.pxd", line 34, in init sklearn.tree._criterion
  File "sklearn/tree/_tree.pxd", line 37, in init sklearn.tree._splitter
  File "sklearn/neighbors/_quad_tree.pxd", line 55, in init sklearn.tree._tree
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/neighbors/__init__.py", line 17, in <module>
    from ._nca import NeighborhoodComponentsAnalysis
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/neighbors/_nca.py", line 22, in <module>
    from ..decomposition import PCA
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/__init__.py", line 17, in <module>
    from .dict_learning import dict_learning
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/dict_learning.py", line 4, in <module>
    from . import _dict_learning
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/_dict_learning.py", line 21, in <module>
    from ..linear_model import Lasso, orthogonal_mp_gram, LassoLars, Lars
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/linear_model/__init__.py", line 12, in <module>
    from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV,
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py", line 30, in <module>
    method='lar', copy_X=True, eps=np.finfo(np.float).eps,
  File "//mnt/sdb/xjh/.local/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

It looks like this process used 3 different python: 1./envs/suv_threesoft/lib/python3.10/; 2./db-vs2/conda_envs/5346076b/lib/python3.8/; 3./mnt/sdb/xjh/.local/lib/python3.8/ I don't know why this process used 3 python and how to avoid this (i.e. change that setting) Thanks!

Hello, have you fix it? when i run the code: virsorter run -w out -i /home/dell/database/H1_assembly.contigs.fa --min-length 1000 -j 16 all and the error is similar.

and this is the error details in /home/dell/database/out/log/iter-0/step3-classify/all-score-ssDNAphage.log:

Traceback (most recent call last): File "/home/dell/miniconda3/envs/vs2/lib/python3.8/site-packages/virsorter/./scripts/classify.py", line 77, in main() File "/home/dell/miniconda3/envs/vs2/lib/python3.8/site-packages/virsorter/./scripts/classify.py", line 60, in main model = joblib.load(model_f) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 658, in load obj = _unpickle(fobj, filename, mmap_mode) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle obj = unpickler.load() File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/pickle.py", line 1212, in load dispatchkey[0] File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/pickle.py", line 1537, in load_stack_global self.append(self.find_class(module, name)) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/pickle.py", line 1579, in find_class import(module, level=0) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/ensemble/init.py", line 7, in from ._forest import RandomForestClassifier File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/ensemble/_forest.py", line 56, in from ..tree import (DecisionTreeClassifier, DecisionTreeRegressor, File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/tree/init.py", line 6, in from ._classes import BaseDecisionTree File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/tree/_classes.py", line 40, in from ._criterion import Criterion File "sklearn/tree/_splitter.pxd", line 34, in init sklearn.tree._criterion File "sklearn/tree/_tree.pxd", line 37, in init sklearn.tree._splitter File "sklearn/neighbors/_quad_tree.pxd", line 55, in init sklearn.tree._tree File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/neighbors/init.py", line 17, in from ._nca import NeighborhoodComponentsAnalysis File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/neighbors/_nca.py", line 22, in from ..decomposition import PCA File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/decomposition/init.py", line 17, in from .dict_learning import dict_learning File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/decomposition/dict_learning.py", line 4, in from . import _dict_learning File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/decomposition/_dict_learning.py", line 21, in from ..linear_model import Lasso, orthogonal_mp_gram, LassoLars, Lars File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/linear_model/init.py", line 12, in from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV, File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py", line 30, in method='lar', copy_X=True, eps=np.finfo(np.float).eps, File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/numpy/init.py", line 305, in getattr raise AttributeError(former_attrs[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

2061574124 commented 4 months ago

Thank you for your help! I'll try to work it out according to your suggestions. And I'm also confused about what's the functions of the /db-vs2/conda_envs/5346076b/, since it was found in my /step3-classify/all-score-ssDNA.log and /step3-classify/all-score-ssDNA.log:

Traceback (most recent call last):
  File "/mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py", line 77, in <module>
    main()
  File "/mnt/sdb/xjh/miniconda3/envs/suv_threesoft/lib/python3.10/site-packages/virsorter/./scripts/classify.py", line 60, in main
    model = joblib.load(model_f)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 658, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle
    obj = unpickler.load()
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1212, in load
    dispatch[key[0]](self)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1537, in load_stack_global
    self.append(self.find_class(module, name))
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/pickle.py", line 1579, in find_class
    __import__(module, level=0)
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/ensemble/__init__.py", line 7, in <module>
    from ._forest import RandomForestClassifier
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/ensemble/_forest.py", line 56, in <module>
    from ..tree import (DecisionTreeClassifier, DecisionTreeRegressor,
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/tree/__init__.py", line 6, in <module>
    from ._classes import BaseDecisionTree
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/tree/_classes.py", line 40, in <module>
    from ._criterion import Criterion
  File "sklearn/tree/_splitter.pxd", line 34, in init sklearn.tree._criterion
  File "sklearn/tree/_tree.pxd", line 37, in init sklearn.tree._splitter
  File "sklearn/neighbors/_quad_tree.pxd", line 55, in init sklearn.tree._tree
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/neighbors/__init__.py", line 17, in <module>
    from ._nca import NeighborhoodComponentsAnalysis
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/neighbors/_nca.py", line 22, in <module>
    from ..decomposition import PCA
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/__init__.py", line 17, in <module>
    from .dict_learning import dict_learning
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/dict_learning.py", line 4, in <module>
    from . import _dict_learning
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/decomposition/_dict_learning.py", line 21, in <module>
    from ..linear_model import Lasso, orthogonal_mp_gram, LassoLars, Lars
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/linear_model/__init__.py", line 12, in <module>
    from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV,
  File "/mnt/sdb/xjh/software/viral-id-sop/db-vs2/conda_envs/5346076b/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py", line 30, in <module>
    method='lar', copy_X=True, eps=np.finfo(np.float).eps,
  File "//mnt/sdb/xjh/.local/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

It looks like this process used 3 different python: 1./envs/suv_threesoft/lib/python3.10/; 2./db-vs2/conda_envs/5346076b/lib/python3.8/; 3./mnt/sdb/xjh/.local/lib/python3.8/ I don't know why this process used 3 python and how to avoid this (i.e. change that setting) Thanks!

Hello, have you fix it? when i run the code: virsorter run -w out -i /home/dell/database/H1_assembly.contigs.fa --min-length 1000 -j 16 all and the error is similar.

and this is the error details in /home/dell/database/out/log/iter-0/step3-classify/all-score-ssDNAphage.log:

Traceback (most recent call last): File "/home/dell/miniconda3/envs/vs2/lib/python3.8/site-packages/virsorter/./scripts/classify.py", line 77, in main() File "/home/dell/miniconda3/envs/vs2/lib/python3.8/site-packages/virsorter/./scripts/classify.py", line 60, in main model = joblib.load(model_f) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 658, in load obj = _unpickle(fobj, filename, mmap_mode) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 577, in _unpickle obj = unpickler.load() File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/pickle.py", line 1212, in load dispatchkey[0] File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/pickle.py", line 1537, in load_stack_global self.append(self.find_class(module, name)) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/pickle.py", line 1579, in find_class import(module, level=0) File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/ensemble/init.py", line 7, in from ._forest import RandomForestClassifier File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/ensemble/_forest.py", line 56, in from ..tree import (DecisionTreeClassifier, DecisionTreeRegressor, File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/tree/init.py", line 6, in from ._classes import BaseDecisionTree File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/tree/_classes.py", line 40, in from ._criterion import Criterion File "sklearn/tree/_splitter.pxd", line 34, in init sklearn.tree._criterion File "sklearn/tree/_tree.pxd", line 37, in init sklearn.tree._splitter File "sklearn/neighbors/_quad_tree.pxd", line 55, in init sklearn.tree._tree File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/neighbors/init.py", line 17, in from ._nca import NeighborhoodComponentsAnalysis File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/neighbors/_nca.py", line 22, in from ..decomposition import PCA File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/decomposition/init.py", line 17, in from .dict_learning import dict_learning File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/decomposition/dict_learning.py", line 4, in from . import _dict_learning File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/decomposition/_dict_learning.py", line 21, in from ..linear_model import Lasso, orthogonal_mp_gram, LassoLars, Lars File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/linear_model/init.py", line 12, in from ._least_angle import (Lars, LassoLars, lars_path, lars_path_gram, LarsCV, File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/sklearn/linear_model/_least_angle.py", line 30, in method='lar', copy_X=True, eps=np.finfo(np.float).eps, File "/home/dell/database/virsorter/conda_envs/3bfc9270/lib/python3.8/site-packages/numpy/init.py", line 305, in getattr raise AttributeError(former_attrs[attr]) AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

jiarong commented 4 months ago

@all, if you are still dealing with conda python dependency headache. There are many solutions, but here the solution I recommend is to use the container version in installation option 3.