Module for interfacing to ASE configuration readers (such as cif and pdb)
It should be possible to extend the CIF reader to include the additional definitions in the mmCIF format.
It is expected that some of the behaviour in
ase_read_cif will be extracted
MDMC.readers.configurations.cif when an MDMC CIF reader is implemented.
- MDMC.MD.ase.cif.ase_read_cif(file: str, **settings: dict) list[Atom]
Reads a configuration file and returns a list of
These Atom objects can optionally have
Coulombicinteractions and also
BondedInteractionobjects if bonded interactions are defined in the CIF file.
atom_typesis passed, then equivalent interactions (
BondedInteraction, if bonded interactions are defined in the CIF file) will be initialized as a single object. For instance if the CIF file includes a benzene ring, then as long as the correct
atom_typesare passed, then there will only be a single C-C
Bondobject, which will include all 6 of the atom pairs. If both
atom_typeswill be used to group
Atomobjects. If neither
atom_typesis passed then each interaction will become a separate object.
Not all CIF files contain bonded interactions (it is only common for biomolecules).
improper dihedrals are not explicitly defined in CIF, so these must be set after initialization of
CIF reader cannot parse CIF files with user defined text sections, so these must be stripped out before reading.
file (file, str) – A
file, or the absolute file name of the configuration file
The index of the configuration in the CIF file. Only a single configuration can be read from a CIF file, with the default being the first (
names(list of str)
A list of
namesfor the atoms in the CIF file. These
namesmust have the same order as the order the atoms in the file. A
namemust be be provided for each atom in the CIF file.
atom_types(list of int)
A list of int for atom types of the atoms in the CIF file. These names must have the same order as the order the atoms in the file. An
atom_typemust be provided for each atom in the CIF file.
A distance (in Ang) at which the
Coulombicinteractions are cutoff. If this is not passed, the
cutoffwill be set to 10.
Whether or not any bonded interactions defined in the CIF file will be included. By default this is True.
Whether or not each atom in the CIF file will be assigned a
Coulombicinteraction with a
Coulombfunction. CIF files do not contain charge information, so the charge of the
Coulombicinteraction will be set to 0. This enables the charges to be set by the application of a
ForceFieldobject. By default this is True.
Atomobjects corresponding to the data in the CIF file
- Return type
- MDMC.MD.ase.cif.get_bonded_interactions_atoms(ase_atoms_info: dict, cif_geom_def: str, atoms_labels: dict) numpy.ndarray
Gets the atoms for each bonded interaction
ase_atoms_info (dict) – A dict containing site labels for one or more of bonds, angles, and torsions. The corresponding values are a list with label (str) for each interaction. The number of site label keys is 2 for bonds, 3 for angles and 4 for torsions. For instance, for bonds there should be ‘_geom_bond_atom_site_label_1’ and ‘_geom_bond_atom_site_label_2’, with each being a list containing the first (or second) site label for each interaction.
cif_geom_def (str) – Specifies whether the interaction type is a bond, angle, or torsion
atoms_labels (dict) – (label:atom) pairs, where label is a str with the _atom_site_label from the CIF file, and atom is the corresponding MDMC
arraywith dimensions (n_interactions, n_atoms_per_interaction). So for 5 bond interactions, the dimensions of the array will be (5, 2), with the zeroeth index containing the two
Atomsinvolved in the zeroeth bond, the first index containing the two
Atomsinvolved in the first bond etc. For bond angle and dihedral interactions, the order of the atoms corresponds to the order required for
- Return type