MMDB file object for MiniMol i/o. More...
#include <minimol_io.h>
Public Member Functions | |
void | read_file (const String &file) |
load MMDB hierarchy from file | |
void | write_file (const String &file, TYPE type=Default) |
save MMDB hierarchy to file | |
void | import_minimol (MiniMol &minimol, const int hnd=-1) |
import MiniMol from MMDB hierarchy | |
void | export_minimol (const MiniMol &minimol) |
export MiniMol to MMDB hierarchy |
MMDB file object for MiniMol i/o.
This object is an i/o object for MiniMol, representing an interface between MiniMol and PDB or CIF files. It is implemented as an MMDB Manager, so MMDB methods may be additionally used on the MMDBfile object.
void clipper::MMDBfile::read_file | ( | const String & | file | ) |
load MMDB hierarchy from file
The file may be either a PDB or mmCIF file. If the spacegroup or cell are not set, they will be taken from the file, otherwise the existing values override the ones in the file.
file | The filename (or pathname) of the file to read. |
References clipper::message.
void clipper::MMDBfile::write_file | ( | const String & | file, | |
TYPE | type = Default | |||
) |
save MMDB hierarchy to file
The output file type will be the same as the file read, otherwise PDB.
file | The filename (or pathname) of the file to write. | |
type | 0=PDB, 1=CIF, 2=binary, default=same as input file, or PDB. |
References clipper::message.
void clipper::MMDBfile::import_minimol | ( | MiniMol & | minimol, | |
const int | hnd = -1 | |||
) |
import MiniMol from MMDB hierarchy
Import data from the MMDB hierarchy into a MiniMol object. All the atoms, residues and chains are imported unless a selection handle is supplied, in which case only the selected atoms and their containers are imported.
Each data is tagged with an optional Property<String> (see clipper::PropertyManager), called "CID", which describes the position in the MMDB hierarchy from which it was taken. This may (optionally) be used later to put a modified element back into the hierarchy.
Any atoms which have alternate conformation codes will also be given an "AltConf" Property<String>.
For more details, see clipper::PropertyManager::exists_property(), clipper::PropertyManager::get_property().
minimol | The minimol to import. | |
hnd | (optional) MMDB selection handle. |
References clipper::Util::b2u(), clipper::MModel::insert(), clipper::MPolymer::insert(), clipper::MMonomer::insert(), clipper::MiniMol::model(), clipper::Atom::null(), clipper::MAtom::set_coord_orth(), clipper::MAtom::set_element(), clipper::MPolymer::set_id(), clipper::MAtom::set_name(), clipper::MAtom::set_occupancy(), clipper::PropertyManager::set_property(), clipper::MMonomer::set_seqnum(), clipper::MMonomer::set_type(), clipper::MAtom::set_u_aniso_orth(), and clipper::MAtom::set_u_iso().
void clipper::MMDBfile::export_minimol | ( | const MiniMol & | minimol | ) |
export MiniMol to MMDB hierarchy
Export data to the MMDB hierarchy from a MiniMol object. All the atoms, residues and chains are exported.
If any MiniMol object has a "CID" Property<String> (see clipper::PropertyManager), then the information from that object will be used to update the corresponding object in the MMDB hierarchy, if it exists. If there is no such entry in the MMDB hierarchy, or if no "CID" Property<String> exists, then a new object will be created in the MMDB hierarchy.
References clipper::MiniMol::cell(), clipper::MAtom::coord_orth(), clipper::MAtom::element(), clipper::PropertyManager::exists_property(), clipper::PropertyManager::get_property(), clipper::MAtom::id(), clipper::MMonomer::id(), clipper::MPolymer::id(), clipper::Util::is_nan(), clipper::Mat33sym< T >::is_null(), clipper::Vec3< T >::is_null(), clipper::Cell::is_null(), clipper::Spacegroup::is_null(), clipper::MiniMol::model(), clipper::MAtom::occupancy(), clipper::MMonomer::seqnum(), clipper::MMonomer::size(), clipper::MPolymer::size(), clipper::MModel::size(), clipper::MiniMol::spacegroup(), clipper::MMonomer::type(), clipper::Util::u2b(), clipper::MAtom::u_aniso_orth(), clipper::MAtom::u_iso(), clipper::Coord_orth::x(), clipper::Coord_orth::y(), and clipper::Coord_orth::z().