OpenMM
|
PDBxFile parses a PDBx/mmCIF file and constructs a Topology and a set of atom positions from it. More...
Public Member Functions | |
def | __init__ |
Load a PDBx/mmCIF file. | |
def | getTopology |
Get the Topology of the model. | |
def | getNumFrames |
Get the number of frames stored in the file. | |
def | getPositions |
Get the atomic positions. | |
Static Public Member Functions | |
def | writeFile |
Write a PDBx/mmCIF file containing a single model. | |
def | writeHeader |
Write out the header for a PDBx/mmCIF file. | |
def | writeModel |
Write out a model to a PDBx/mmCIF file. | |
Public Attributes | |
topology | |
The Topology read from the PDBx/mmCIF file. | |
positions | |
The atom positions read from the PDBx/mmCIF file. |
PDBxFile parses a PDBx/mmCIF file and constructs a Topology and a set of atom positions from it.
def __init__ | ( | self, | |
file | |||
) |
Load a PDBx/mmCIF file.
The atom positions and Topology can be retrieved by calling getPositions() and getTopology().
file | (string) the name of the file to load. Alternatively you can pass an open file object. |
def getNumFrames | ( | self | ) |
Get the number of frames stored in the file.
def getPositions | ( | self, | |
asNumpy = False , |
|||
frame = 0 |
|||
) |
Get the atomic positions.
asNumpy | (bool=False) if true, the values are returned as a numpy array instead of a list of Vec3s |
frame | (int=0) the index of the frame for which to get positions |
def getTopology | ( | self | ) |
Get the Topology of the model.
def writeFile | ( | topology, | |
positions, | |||
file = sys.stdout , |
|||
keepIds = False , |
|||
entry = None |
|||
) | [static] |
Write a PDBx/mmCIF file containing a single model.
topology | (Topology) The Topology defining the model to write |
positions | (list) The list of atomic positions to write |
file | (file=stdout) A file to write to |
keepIds | (bool=False) If True, keep the residue and chain IDs specified in the Topology rather than generating new ones. Warning: It is up to the caller to make sure these are valid IDs that satisfy the requirements of the PDBx/mmCIF format. Otherwise, the output file will be invalid. |
entry | (str=None) The entry ID to assign to the CIF file |
def writeHeader | ( | topology, | |
file = sys.stdout , |
|||
entry = None |
|||
) | [static] |
Write out the header for a PDBx/mmCIF file.
topology | (Topology) The Topology defining the molecular system being written |
file | (file=stdout) A file to write the file to |
entry | (str=None) The entry ID to assign to the CIF file |
def writeModel | ( | topology, | |
positions, | |||
file = sys.stdout , |
|||
modelIndex = 1 , |
|||
keepIds = False |
|||
) | [static] |
Write out a model to a PDBx/mmCIF file.
topology | (Topology) The Topology defining the model to write |
positions | (list) The list of atomic positions to write |
file | (file=stdout) A file to write the model to |
modelIndex | (int=1) The model number of this frame |
keepIds | (bool=False) If True, keep the residue and chain IDs specified in the Topology rather than generating new ones. Warning: It is up to the caller to make sure these are valid IDs that satisfy the requirements of the PDBx/mmCIF format. Otherwise, the output file will be invalid. |
The atom positions read from the PDBx/mmCIF file.
If the file contains multiple frames, these are the positions in the first frame.
The Topology read from the PDBx/mmCIF file.