PDB-REDO / alphafill

AlphaFill is an algorithm based on sequence and structure similarity that “transplants” missing compounds to the AlphaFold models. By adding the molecular context to the protein structures, the models can be more easily appreciated in terms of function and structure integrity.
https://alphafill.eu
BSD 2-Clause "Simplified" License
89 stars 16 forks source link

YASARA refine #7

Closed JinyuanSun closed 2 years ago

JinyuanSun commented 2 years ago

Of which YASARA version is required to run the refine.mcr scripts?

yasara -txt refine.mcr modelin='AF-Q9ZV05-F1-model_v1.cif' modelout='refined.cif'

I ran the script but got an error:

Macro>AF-Q9ZV05-F1-model_v1.cif - ERROR - Unknown command, syntax error or undefined Yanaconda variable just before line 2. If there is no typing mistake, this is either a WHAT IF command (type WHATIF first), or you need a newer version of YASARA to run this command. Get an update from www.yasara.org/update.
 Error 724 occurred, the macro has been stopped.
drlemmus commented 2 years ago

We use a very new version of YASARA dynamics. Which version do you have?

JinyuanSun commented 2 years ago

Version 15.3.8, I guess my YASARA is a little bit old. I try to find this bug line by line, and it seems that I cannot load the cif file using LoadCIF command:

>LoadCIF AF-Q9ZV05-F1-model_v1.cif, Center=No, Correct=No
 - ERROR - Unexpected characters found at 'Correct=No'. This error can also be caused by command arguments specified in an incorrect order.

>LoadCIF AF-Q9ZV05-F1-model_v1.cif                       
==============================
*** Open Babel Warning  in ExtractSpacegroup
  CIF Error: missing spacegroup description: defaulting to P1... (in data block:data_AF-Q9ZV05-F1)
==============================
*** Open Babel Error  in ExtractUnitCell
  CIF Error: missing a,b and c value - cannot interpret structure ! (in data block:data_AF-Q9ZV05-F1)
==============================
*** Open Babel Error  in Cartesian2FractionalCoord
  Lattice parameters are not available.
 - WARNING - This molecule is too large to be converted to YASARA's internal SMILES format, most likely the atoms need to be divided into multiple residues like proteins or DNA.
 - Molecule 1/1 (AF-Q9ZV05-F1-model_v1.cif) loaded as object 1 (0 atoms).
drlemmus commented 2 years ago

Indeed, it is seven years old, that could be part of the problem. The other problem it seems is that you may be trying to refine a model straight out of AlphaFill you need to create a model with just one transplant, otherwise the refinement will definitely go wrong.

JinyuanSun commented 2 years ago

OK. I solved this. It seems that this version just cannot take care of mmCIF, I have to use a PDB version. So I modified the macro script.

# refine_pdb.mcr: a YASARA macro energy minimize an AlphaFill model
# Runs the default YASARA energy minimization experiment. The returned model is protonated.  
#
# Version 0.01
#
# Minimum YASARA tier: YASARA dynamics 
#
# This script was created by Robbie P. Joosten (r.joosten@nki.nl)
# Reference: If you publish results (directly or indirectly) obtained by using this macro, please cite YASARA and (any of)
# these publications:
# 1) Maarten L. Hekkelman, Ida de Vries, Robbie P. Joosten, Anastassis Perrakis: "­AlphaFill: enriching AlphaFold models 
#    with  ligands and co-factors" (2022)
#
# Changelog:
# Version 0.01
# - First attempt.
#
# YASARA input variables:
# modelin  The mmCIF file of the Alphafill model
# modelout The minimised AlphaFill model
#
#Initialise
OnError Exit
Console off
Processors 8

#Check the YASARA version
if (Dynamics)==0
  Print "YASARA version too low, you need at least YASARA Dynamics"
  exit

#Load the model

LoadPDB (modelin), Center=No, Correct=No

#Setup the forcefield
Forcefield NOVA
Longrange None
Cutoff 10.5
Boundary Wall

#Do the energy minimization (default settings)
Experiment minimization
Experiment On

# Wait till end of experiment
Wait ExpEnd

#Write the PDB coordinate file
SavePDB 1, (modelout)

exit

And ran this command:

~/biosoft/yasara/yasara refine_pdb.mcr "modelin = 'refine_test.pdb'" "modelout = 'refined_.pdb'" -txt

The first error was because of a syntax error of YASARA command, I missed "" out of a variable assignment.