Get Topological Information¶
Classes¶
-
class
topology.LC(name)¶ Bases:
topology.ReadItpA Liquid Crystal monomer has the following attributes which are relevant to building and crosslinking:
Attributes:
Description of annotations: “R” : reference atom: This atom defines the pore radius, r. It will be placed r nm from pore center “P” : plane atoms: 3 atoms defining a plane within the monomer which you want to be parallel to the xy plane “L” : line atoms: 2 atoms used to rotate monomers on xy plane so that the line created by line atoms goes through the pore center. “C1” : terminal vinyl carbon on tails. (for cross-linking) “C2” : second to last vinyl carbon on tails (for cross-linking) “B” : carbon atoms making up benzene ring
name: A string representing the monomer’s name. natoms: An integer accounting for the number of atoms in a single monomer. build_mon: Monomer used to build the unit cell images: Number of periodic images to be used in calculations c1_atoms: A list of atoms which will be involved in crosslinking as ‘c1’ – See xlink.py c2_atoms: A list of atoms which will be involved in crosslinking as ‘c2’ – See xlink.py tails: Number of tails on each monomer residues: A list of the minimum residue names present in a typical structure no_vsites: A string indicating whether there are dummy atoms associated with this monomer.
- Notes:
- Name of .gro and .itp are assumed to be the same unless otherwise specified. Whatever you pass to this class should be the name of the .gro/.itp file and it will read the annotations and directives
-
__init__(name)¶ Get attributes from .itp file in addition to some liquid crystal specific attributes
Parameters: name – name of .itp file
-
class
topology.Residue(name, connectivity=False)¶ Bases:
topology.ReadItp-
__init__(name, connectivity=False)¶ Get attributes of residue based on an .itp file
Parameters: - name (str) – name of .itp file (no extension)
- connectivity (bool) – get bonds, improper dihedrals and virtual sites
-
-
class
topology.ReadItp(name)¶ Bases:
objectRead and store information from a GROMACS topology file
Parameters: name – name of GROMACS topology file Returns: charge, -
__init__(name)¶ Read in .itp file and initialize data structures
Parameters: name (str) – name of itp (without extension)
-
atoms(annotations=False)¶ Read itp line-by-line, extract annotations (optional) and determine number of atoms, atom indices, names, mass, charges and residue molecular weight
Parameters: annotations (bool) – If True, read annotations
-
get_bonds()¶ Store all information in the “[ bonds ]” section of name.itp
-
get_improper_dihedrals()¶ Store all information in the “[ dihedrals ] ; impropers” section of name.itp
-
get_vsites()¶ Store all information in the “[ virtual_sites ]” section of name.itp
-
organize_bonds()¶ Determine how each atom is bonded
Returns: A dict with keys that are atom indices and values that are all of the atom indices to which they are bonded :rtype: dict
-
Functions¶
-
topology.map_atoms(indices, nres_atoms=1)¶ Map the indices of a sub-system to indices of the full system
Parameters: - indices (list) – indices of atoms to map with respect to full system
- nres_atoms (int) – number of atoms per residue
Returns: dictionary of mapped indices
-
topology.fix_names(gro, force_convert=True)¶ Workaround for mdtraj. Fix atom names so they are the same as those shown in the gro file.
Parameters: - gro (str) – name of .gro file with all atom names in it
- force_convert (bool) – If this option is True, then it will convert the .gro to .pdb no matter what. If False and a .pdb file of the same name as gro exists, this function will use that .pdb in order to load standard atom names.