Dear users,
I'm willing to create a peptide sequence from a fasta sequence, and add a disulfide bridge in it.
At the moment, my code "which works" is like this pseudo-code:
1 - create a model object, and model.build('sequence'), I am not applying any time of secondary structure constraint 2 - write this pdb (peptide.pdb) 3 - create a special align where target and template are identical (peptide.ali) 4 - create a new object, Mymodel derived from automodel to add the patch for disulfides 5 - generate models 6 - select the best one (peptide-cys.pdb)
I'm only willing to retrieve the "peptide-cys.pdb" file, can I bypass steps 2,3 and act directly on the initial model object created?
The implementation of the pseudo-code above is:
#####################################################################
# This demonstrates the use of alignment.append_sequence() and # model.build_sequence() to build residue sequences from one-letter codes # http://salilab.org/modeller/manual/node171.html
from modeller import * from modeller.automodel import *
env.libs.topology.read('${LIB}/top_heav.lib') env.libs.parameters.read('${LIB}/par.lib')
# Create a new empty alignment and model: aln = alignment(env) mdl = model(env)
mdl.build_sequence('ACAAAAACYAAAA') mdl.write(file='pept.pdb')
class MyModel(automodel): def special_patches(self, aln): # The disulfide bridge is taken from the input sequence self.patch(residue_type='DISU', residues=(self.residues['2', self.residues['8']))
a = MyModel(env, alnfile = "tmppiralign.ali", knowns = "pept", sequence = "pept-cys")
a.starting_model= 1 a.ending_model = 10
a.make()
#####################################################################
tmppiralign.ali is of the form:
##################################################################### >P1;pept structureX:pept:1: :13: :::: ACAAAAACYAAAA* >P1;pept-cys sequence:pept-cys::FIRST:@ END ::::: ACAAAAACYAAAA* #####################################################################
Thanks a lot for corrections, suggestions,..
Stéphane