donaldlab / OSPREY3

Open Source Protein REdesign for You v3
GNU General Public License v2.0
47 stars 15 forks source link

residue(s) could not be matched to templates #163

Open x811zou opened 3 years ago

x811zou commented 3 years ago

Hi! I am very new to OSPREY, and I did not find anyone asked this problem before. I was trying to run OSPREY on a PDB structure 7KMB using the provided kstar.py, here are my modified code:

import osprey
osprey.start()

#### choose a forcefield
ffparams = osprey.ForcefieldParams()

#### read a PDB file for molecular info
mol = osprey.readPdb('7KMB.pdb')

#### make sure all strands share the same template library
templateLib = osprey.TemplateLibrary(ffparams.forcefld)

#### define the protein strand
protein = osprey.Strand(mol, templateLib=templateLib, residues=['G492','G494'])
protein.flexibility['G493'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

and error occurs here:

WARNING: 3 Strand residue(s) could not be matched to templates and were automatically deleted: LEU G 492 GLN G 493 SER G 494 Traceback (most recent call last): File "kstar_7KMB.py", line 17, in protein.flexibility['G493'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous() AttributeError: 'NoneType' object has no attribute 'setLibraryRotamers'

I also tried using mutagensis function in pymol to replace the three residues listed above, but still getting the same error. Does anyone know what does this error mean? Thanks!

cuchaz commented 3 years ago

That warning means Osprey wasn't able to match those residues to its internal database of residues, aka "templates". Osprey uses these templates to determine where the bonds are in the molecule, since the PDB file format doesn't provide that information.

When Osprey can't match templates correctly, usually there's something different about that residue that causes it to not match the canonical residue definition in the template database. Sometimes that's caused by non-standard chain caps, or missing atoms, extra atoms, etc.