Step 3

A program for converting the edited PDB model file from Step 2 and the original PDB file into a system is:

# . Set the aliases - new/old.
_Aliases = [ ( "A:ATP.400:O3B", "A:ANP.400:N3B" ), \
             ( "A:ATP.400:*"  , "A:ANP.400:*"   ), \
             ( "A:MG.*:MG"    , "A:MN.*:MN"     ), \
             ( "I:SER.17:*"   , "I:ALA.17:*"    )  ]

# . Get the model.
model = PDBModel_FromModelFile ( "../step2/step2.model" )
model.Summary ( )

# . Get its raw counterpart.
rawModel = PDBFile_ToPDBModel ( "1CDK.pdb" )

# . Make the atomic model.
model.MakeAtomicModelFromComponentLibrary ( )
model.ExtractAtomData ( rawModel, aliases = _Aliases )
model.Summary ( )

# . Make a system.
system = model.MakeSystem ( )
system.Summary ( )

# . Save the system.
Pickle ( "step3.pkl", system ) 

The salient features of this program are:

    • A new model is created from the edited file using the function PDBModel_FromModelFile and the original model is regenerated from the PDB file.
    • An atomic model is built for model using the method MakeAtomicModelFromComponentLibrary.
      • This program will fail if it is run with the default PDB component library that comes with the pDynamo distribution because information about the components ATP, MG and TPO is missing. The appropriate definitions need to be added, following the procedures in Step 3a, and the program rerun.
    • Once the atomic model has been built, coordinate and other data for the atoms is extracted from the original model with the method ExtractAtomData. Data is taken for all atoms with matching sequence specifications. Those atoms for which no match occurs will have undefined coordinates. This is typically the case for hydrogens.
      • The aliases argument to the method is only necessary when the sequence specification of some residues differs between the old and new PDB models. The argument, which can be a list or tuple, provides a mapping between the new and old specifications. Each alias consists of a pair of strings, the first corresponding to the new model and the second to the old model. The specifications are of the usual form for atom paths in a sequence except that wildcard characters "*" can also be employed which match any value in a field. Currently there is the restriction that wildcards appear in the same positions in the new and old specifications. Finally, it should be noted that aliases are processed in the order that they appear in the argument so more specific aliases should be placed before more general ones.
      • For PKA, the residues in the new model that are affected are ATP and MG of entity A and SER.17 of entity I. The ATP mapping is more complicated than the others. This is because the non-hydrogen atoms (and their names) in ATP and ANP are identical except for the oxygen O3B which is replaced by the nitrogen N3B. The less specific, second mapping covers the case where the atom names are the same whereas the more specific, first mapping is necessary if the coordinates of ANP.400:N3B are to be transferred to ATP.400:O3B.
    • The model is transformed into a system using the method MakeSystem. Although absent here, this method can take an argument which allows atom data with a specific altLoc code to be chosen for the system's coordinates. By default the data corresponding to the conformation with highest occupancy (normally altLoc = "A") is employed.
    • The program terminates by pickling the system to an external file for use in subsequent steps.