bacpop / PopPUNK

PopPUNK 👨‍🎤 (POPulation Partitioning Using Nucleotide Kmers)
https://www.bacpop.org/poppunk
Apache License 2.0
88 stars 18 forks source link

poppunk 2.4.0: sklearn version not compatible with poppunk #198

Closed nicola-palmieri closed 2 years ago

nicola-palmieri commented 2 years ago

Versions

poppunk 2.4.0

Command used and output returned

poppunk_assign --db ecoli_poppunk_db --query list_of_genomes.txt --output poppunk-out --threads 14

(poppunk_assign:59556): Gtk-WARNING **: 12:23:26.729: Locale not supported by C library.
    Using the fallback 'C' locale.
PopPUNK: assign
    (with backend: sketchlib v1.7.4
     sketchlib: /Users/nicola.palmieri/miniconda3/envs/poppunk_env/lib/python3.9/site-packages/pp_sketchlib.cpython-39-darwin.so)

Graph-tools OpenMP parallelisation enabled: with 14 threads
Mode: Assigning clusters of query sequences

Traceback (most recent call last):
  File "/Users/nicola.palmieri/miniconda3/envs/poppunk_env/bin/poppunk_assign", line 11, in <module>
    sys.exit(main())
  File "/Users/nicola.palmieri/miniconda3/envs/poppunk_env/lib/python3.9/site-packages/PopPUNK/assign.py", line 519, in main
    assign_query(dbFuncs,
  File "/Users/nicola.palmieri/miniconda3/envs/poppunk_env/lib/python3.9/site-packages/PopPUNK/assign.py", line 106, in assign_query
    model = loadClusterFit(model_file + '.pkl',
  File "/Users/nicola.palmieri/miniconda3/envs/poppunk_env/lib/python3.9/site-packages/PopPUNK/models.py", line 92, in loadClusterFit
    fit_object, fit_type = pickle.load(pickle_obj)
ModuleNotFoundError: No module named 'sklearn.mixture.bayesian_mixture'

Describe the bug

I have installed poppunk in a completely fresh conda environment, but got the error above after I tried to assign 4 new strains to a previously downloaded database from this paper (https://www.microbiologyresearch.org/content/journal/mgen/10.1099/mgen.0.000499). I think the version is sklearn is not compatible with poppunk. How should I proceed?

Thank you! Nicola

johnlees commented 2 years ago

What version of sklearn do you have? Assuming you installed with conda, can you please post the result of running conda list?

johnlees commented 2 years ago

This may also be a problem with using these previous databases, which are not compatible with poppunk v2. New databases can be found here: https://poppunk.net/pages/databases.html

If you need to use an old database, you'll need to downgrade to poppunk 1.2.2 (https://poppunk.readthedocs.io/en/v1.2.2-docs/), but I wouldn't typically recommend this.

nicola-palmieri commented 2 years ago

Many thanks for this, I will try to use the new database.