Keywords: manual

Next: model.clear_topology() clear Up: The model class: handling Previous: model.build_sequence() build Contents Index

## model.write() -- write MODEL

`write(file, model_format='PDB', no_ter=False)`

> This command writes the current MODEL to a file in the selected format.

> file can be either a file name or a modfile.File() object open in write mode (in which case the structure is appended to the file).

> If you want to only write out a subset of the atoms, see selection.write().

> `'PDB'` writes out files in the Protein Data Bank (PDB) format. Note that the isotropic temperature factor (B ) field can be set by selection.energy() or model.write_data().

> `'MMCIF'` writes out files in the Macromolecular Crystallographic Information File (mmCIF) format.

> The `'GRASP'` format is the same as the `'PDB'` format, except that it includes two special lines at the top of the file and the atomic radii and charges in the columns following the Cartesian coordinates of atoms. This format is useful for input to program GRASP, written by Anthony Nicholls in the group of Barry Honig at Columbia University [Nicholls et al., 1991]. For GRASP output, the atomic radii are needed. This usually means using the complete_pdb() script rather than model.read() to read in any original PDB file.

> A number of MODELLER-specific REMARKs are added when writing out PDB files (and are parsed when reading such files back in with model.read()):

- `REMARK 6 MODELLER OBJECTIVE FUNCTION`: the value of model.last_energy.

- `REMARK 6 MODELLER BEST TEMPLATE % SEQ ID`: the value of model.seq_id.

- `REMARK 6 MODELLER BLK RESIDUE`: for each residue treated as a BLK, the residue number and chain ID. (This ensures that when the model is read back in, those BLK residues are still treated as BLK, even if the topology file contains a definition for that residue type.)

> The contents of model.remark are also added to PDB files verbatim.

Example: See model.read() command.

Next: model.clear_topology() clear Up: The model class: handling Previous: model.build_sequence() build Contents Index