| name | homology-modeling |
| description | Homology modeling and template-based structure prediction. Use when building 3D protein models from sequence using known structures as templates, or selecting templates for comparative modeling. |
Homology Modeling
Template-based protein structure prediction.
MODELLER
from modeller import *
from modeller.automodel import *
# Set up environment
env = Environ()
env.io.atom_files_directory = ['.', 'atom_files']
# Create alignment
aln = Alignment(env)
aln.append(file='alignment.ali')
# Build model
a = AutoModel(env, alnfile='alignment.ali',
knowns='template', sequence='target')
a.starting_model = 1
a.ending_model = 5
a.make()
Template Selection
from Bio.Blast import NCBIWWW, NCBIXML
def find_templates(sequence, evalue_threshold=0.001):
"""Find structural templates via BLAST."""
result = NCBIWWW.qblast("blastp", "pdb", sequence)
records = NCBIXML.parse(result)
templates = []
for record in records:
for alignment in record.alignments:
for hsp in alignment.hsps:
if hsp.expect < evalue_threshold:
templates.append({
'pdb_id': alignment.hit_id.split('|')[1],
'evalue': hsp.expect,
'identity': hsp.identities / hsp.align_length
})
return templates
Model Quality Assessment
# DOPE score in MODELLER
def assess_model(model_file):
env = Environ()
mdl = Model(env, file=model_file)
atmsel = Selection(mdl)
score = atmsel.assess_dope()
return score