MrOlm / drep

Rapid comparison and dereplication of genomes
246 stars 36 forks source link

"NameError: name 'dm' is not defined" when using dRep compare_wf #73

Closed Niicii closed 4 years ago

Niicii commented 4 years ago

Hello,

I installed dRep as explained in the installation guide on openSUSE leap 15.1. When running dRep compare_wf analysis/ -g ./genomes/*.fasta using two differently assembled metagenomes as testrun I got the following error.

dRep compare_wf analysis/ -g ./genomes/*.fasta
Step 1. Cluster
Step 1. Parse Arguments
Step 2. Perform MASH (primary) clustering
2a. Run pair-wise MASH clustering
Traceback (most recent call last):
  File "/home/wenzel/anaconda3/bin/dRep", line 33, in <module>
    controller.parseArguments(args)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/controller.py", line 146, in parseArguments
    self.compare_wf_operation(**vars(args))
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/controller.py", line 91, in compare_wf_operation
    drep.d_workflows.compare_wrapper(kwargs['work_directory'],**kwargs)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/d_workflows.py", line 92, in compare_wrapper
    drep.d_cluster.d_cluster_wrapper(wd, **kwargs)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/d_cluster.py", line 58, in d_cluster_wrapper
    Cdb, Mdb, Ndb = cluster_genomes(Bdb, data_folder, wd=workDirectory, **kwargs)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/d_cluster.py", line 137, in cluster_genomes
    Mdb = all_vs_all_MASH(Bdb, data_folder, **kwargs)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/d_cluster.py", line 606, in all_vs_all_MASH
    dm.thread_cmds(cmds, logdir=logdir, t=int(p))
NameError: name 'dm' is not defined

Mash is installed as are the other dependencies except centrifuge:

dRep bonus testDir --check_dependencies
Loading work directory
Checking dependencies
mash.................................... all good        (location = /usr/local/bin/mash)
nucmer.................................. all good        (location = /usr/local/bin/nucmer)
checkm.................................. all good        (location = /home/wenzel/anaconda3/bin/checkm)
ANIcalculator........................... all good        (location = /usr/local/bin/ANIcalculator)
prodigal................................ all good        (location = /usr/local/bin/prodigal)
centrifuge.............................. !!! ERROR !!!   (location = None)

Trying to run dRep dereplicate_wf ./analysis/ -g ./genomes/*.fasta I get the following output:

***************************************************
    ..:: dRep Step 1. Filter ::..
***************************************************

Traceback (most recent call last):
  File "/home/wenzel/anaconda3/bin/dRep", line 33, in <module>
    controller.parseArguments(args)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/controller.py", line 144, in parseArguments
    self.dereplicate_wf_operation(**vars(args))
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/controller.py", line 86, in dereplicate_wf_operation
    drep.d_workflows.dereplicate_wrapper(kwargs['work_directory'],**kwargs)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/d_workflows.py", line 28, in dereplicate_wrapper
    drep.d_filter.d_filter_wrapper(wd, genomes = genomes, Chdb = Chdb, **kwargs)
  File "/home/wenzel/anaconda3/lib/python3.7/site-packages/drep/d_filter.py", line 54, in d_filter_wrapper
    if wd.hasDb('Bdb'):
AttributeError: 'str' object has no attribute 'hasDb'

Do you have any advice how to fix this errors ?

Best wishes, Laura

MrOlm commented 4 years ago

Hi Laura,

It looks like you have an old version of dRep installed (potentially alongside a new version as well). What version does it say you have? (you can see by running dRep -h).

To upgrade versions you can use the command pip install drep --upgrade, but this doesn't always work when it's confused because you have multiple versions floating around. When I do when I encounter this is to first remove all traces of dRep (making sure that the commands dRep -h and import dRep (the later within python) fail), and then reinstall it. You don't need to remove and dependencies, just dRep itself.

Good luck and let me know if this doesn't fix the issue!

-Matt

Niicii commented 4 years ago

Hallo Matt,

The version I have installed currently is dRep v1.4.3 To me it seems to be the current latest release on github. If I overlooked version 2 I would be happy to get a hint.

pip install drep --upgrade is indeed not working for me so I will try removing dRep and reinstalling.

ERROR: Could not find a version that satisfies the requirement drep (from versions: none)
ERROR: No matching distribution found for drep
MrOlm commented 4 years ago

Hi Laura,

Apologies- I don't update that releases thing much any more, but did just push a new release (version 2.5.3).

It's also weird that the pip command isn't working- that should simply get the latest version from pypi (https://pypi.org/project/drep/)

However if you download the latest release (version 2.5.4) and install it as you did the older version, that should work as well

-Matt

Niicii commented 4 years ago

I guess my pip seems to be broken, I'll try to fix this and come back to you when it's working. Thanks so far for your help :)