volkamerlab / opencadd

A Python library for structural cheminformatics
https://opencadd.readthedocs.io
MIT License
91 stars 18 forks source link

mmligner #16

Closed Koesed96 closed 4 years ago

Koesed96 commented 4 years ago

Description

Provides a Wrapper for the MMligner.

Todos

Status

codecov-io commented 4 years ago

Codecov Report

Merging #16 into master will increase coverage by 0.02%. The diff coverage is 50.00%.

Koesed96 commented 4 years ago

Sorry for the failing tests. As far as I can tell the problem is that the patches to mmligner are not adopted.

jaimergp commented 4 years ago

No probs, I'll take that! Thanks for the changes!

hovo1990 commented 3 years ago

Hi there, When I am trying to use MMLigner, I get the following error:

` mmligner = MMLignerAligner()

results_mm = mmligner.calculate([mol1_protein, mol2_protein])`

Current MMLigner wrappers produces accurate RMSD values but slightly shifted structures! /home/i-am-curious/.conda/envs/pyscience/lib/python3.7/site-packages/MDAnalysis/coordinates/PDB.py:1028: UserWarning: Found no information for attr: 'tempfactors' Using default value of '0.0' "".format(attrname, default)) /home/i-am-curious/.conda/envs/pyscience/lib/python3.7/site-packages/MDAnalysis/core/topologyattrs.py:2011: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray np.array(sorted(unique_bonds)), 4) -------------------------------------------------------------------------- UnboundLocalError Traceback (most recent call last)

in 1 mmligner = MMLignerAligner() ----> 2 results_mm = mmligner.calculate([mol1_protein, mol2_protein]) ~/.conda/envs/pyscience/lib/python3.7/site-packages/opencadd/structure/superposition/engines/base.py in calculate(self, structures, *args, **kwargs) 29 """ 30 assert len(structures) == 2 ---> 31 return self._calculate(structures, *args, **kwargs) 32 33 def _calculate(self, structures, *args, **kwargs): ~/.conda/envs/pyscience/lib/python3.7/site-packages/opencadd/structure/superposition/engines/mmligner.py in _calculate(self, structures, *args, **kwargs) 94 ) 95 # We need access to the temporary files at parse time! ---> 96 result = self._parse_metadata(output.decode()) 97 superposed_models = self._calculate_transformed(structures, result["metadata"]) 98 result["superposed"] = superposed_models ~/.conda/envs/pyscience/lib/python3.7/site-packages/opencadd/structure/superposition/engines/mmligner.py in _parse_metadata(self, output) 142 # if the patched mmligner is used (check /devtools/conda-recipes/mmligner) 143 # -- this will fail in CI for now -- --> 144 translation = fixed_com - moving_com 145 146 alignment = fasta.FastaFile() UnboundLocalError: local variable 'fixed_com' referenced before assignment

Is there a problem with the installation?

jaimergp commented 3 years ago

Nop, probably a bug in our wrapper. I'll create an issue to deal with this in a separate PR. Thanks for the report!