## model.read() — read coordinates for MODEL

`read(file, model_format='PDB', model_segment=('FIRST:@', 'LAST:'), io=None, keep_disulfides=False)`

> 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'` or `'MMCIF'` formats), or patches (such as disulfides); to make these assignments, which are necessary for almost all energy commands, use model.generate_topology().

> file can be a filename or a readable file handle (see modfile.File()).

> The `'PDB_OR_MMCIF'` file format will read an mmCIF file if the filename ends in `'.cif'`; otherwise it will read a PDB file.

> 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.

> Certain noncanonical residues (such as MSE) are automatically mapped to their closest canonical types by default; see io_data.convert_modres for more details.

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

> keep_disulfides, if set to `True`, will preserve any disulfide information already stored in the model. (The default is `False`, which discards it.) This should only be used if the model being read in is guaranteed to have the same sequence and atom ordering as the model in memory. This is primarily used by the `automodel` class to copy `SSBOND` records from the initial model (`.ini` file) to final output models.

> 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 or mmCIF files with alternate locations (characters in column 17 of PDB ATOM or HETATM records; `'_atom_site.label_alt_id'` in mmCIF), 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.)

> For PDB files that contain multiple models (each starting with a `'MODEL'` record and ending with an `'ENDMDL'` record), only the first model is read. For mmCIF files, only models in the first `'data_'` block and with `'_atom_site.pdbx_PDB_model_num'` equal to 1 are read.

> The model's R value is read from appropriately formatted PDB REMARKs or the mmCIF `'_refine'` or `'_pdbx_refine'` categories 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. The same information is read from mmCIF files from MODELLER-specific categories.

> Certain residues (e.g., waters or HETATM records) can be skipped when reading the file, and some modified residues are automatically converted to the nearest equivalent standard amino acids; see io_data().

> 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 both CHARMM and mmCIF atom files 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')