#!/usr/bin/python

"""
Model Src missing residues from X-ray structure after processing by PyMOL.
3LCK is used as a template for missing residues

TODO:
* Fix whatever is wrong with modeling chain A of a403t.
* Ensure HETATMs (like ligands and crystallographic waters) are retained during modelling.
* Allow reversion mutations to be encoded if desired during or after modelling.
* Allow all chains to be modelled, rather than just desired chains?
"""



#sourcepdb_filename = 'system.pdb'
#seqres_filename = 'src-seqres-B.txt'
#outputpdb_filename = 'modelled-with-hetatm.pdb'

sourcepdb_filename = 'src_tbosutinib_c4+d2_refine_waters_tls_38-seqres.pdb'
outputpdb_filename = 'src_tbosutinib_c4+d2_refine_waters_tls_38.modeller.pdb'
chainid = 'B'

#sourcepdb_filename = 'a403t_bosut_refine_nl5_30-seqres.pdb'
#outputpdb_filename = 'a403t_bosut_refine_nl5_30.modeller.pdb'
#chainid = 'A' # chain B has DFG loop flipped the wrong way

templates = ['3LCK']

import modelPDB2 as modelPDB
myModel = modelPDB.ModelPDB()
myModel.modelMissingAtoms(sourcepdb_filename, outputpdb_filename, chain=chainid, debug=True, templates=templates)

#import modelPDB3 as modelPDB
#myModel = modelPDB.ModelPDB()
#myModel.modelMissingAtoms(sourcepdb_filename, outputpdb_filename, chain=chainid, debug=True, templates=templates, retainHETATM=True)
