next up previous contents index
Next: model.build_sequence() build Up: The model class: handling Previous: model.loops() return   Contents   Index

model.read() -- read coordinates for MODEL

read(file, model_format='PDB', model_segment=('FIRST:@', 'LAST:'), io=None)
This command reads the atomic coordinates, atom names, residue names, residue numbers, isotropic temperature factors and segment specifications for MODEL, assigns residue types, and defines the dihedral angles listed in the $RESDIH_LIB library. For CHARMM and UHBD file formats, it also reads the atomic charges. However, it does not assign CHARMM and MODELLER atom types, internal coordinates, charges (in the case of the 'PDB' format), or patches (such as disulfides); to make these assignments, which are necessary for almost all energy commands, use model.generate_topology(). All real and pseudo atoms are selected. The PDB residue type 'HIS' is assigned the CHARMM residue type 'HSD', which is the neutral His with H on ND1. The PDB types 'ASP' and 'GLU' are assigned the corresponding charged CHARMM residue types, as are 'LYS' and 'ARG'. These conventions are relevant only if Coulomb terms and/or hydrogens are used.

model_segment sets the beginning and ending residue identifiers for the contiguous sequence of residues to be read from the PDB file (this option does not work yet for the other file formats). The format of residue identifiers is described in Section B.1.

Note that this command reads in the model file directly, and does no special handling to ensure the file is suitable for energy evaluations (e.g., that it has no missing atoms). If you want to read in a PDB file from PDB or generated from an experiment or some other program, it is recommended that you use the complete_pdb() script instead.

For PDB files with alternate locations (characters in column 17 of ATOM or HETATM records), MODELLER reads only the first alternate location encountered for each residue. (This differs from older versions of MODELLER, which would read only alternate locations marked with A or 1.)

The model's R value is read from appropriately formatted PDB REMARKs and is available as Sequence.rfactor. The first valid R value (not free R) found in the PDB file is used.

Some MODELLER-specific REMARKs are also read from PDB files if they are present. See model.write() for a list of such REMARKs.

This command can raise a FileFormatError if the atom file format is invalid.

Example: examples/commands/read_model.py


# Example for: model.read(), model.write()

# This will read a PDB file and write a CHARMM atom file without atomic charges
# or radii. For assigning charges and radii, see the all_hydrogen.py script.

from modeller import *

env = environ()
env.io.atom_files_directory = ['../atom_files']

mdl = model(env)
mdl.read(file='1fas')
mdl.write(file='1fas.crd', model_format='CHARMM')
mdl.write(file='1fas.cif', model_format='MMCIF')


next up previous contents index
Next: model.build_sequence() build Up: The model class: handling Previous: model.loops() return   Contents   Index
Automatic builds 2010-04-21