Atom

This module defines classes to handle individual atoms.

class Atom(ag, index, acsi)[source]

A class for handling individual atoms in an AtomGroup.

copy()

Returns a copy of atoms (and atomic data) in an AtomGroup instance.

getACSIndex()

Returns index of the coordinate set.

getACSLabel()

Returns active coordinate set label.

getAltloc()

Return alternate location indicator of the atom. Alternate location indicator can be used in atom selections, e.g. 'altloc A B', 'altloc _'.

getAnisou()[source]

Returns a copy of anisotropic temperature factors of the atom from the active coordinate set.

getAnisous()

Returns a copy of anisotropic temperature factors from the active coordinate set.

getAnistd()

Return standard deviations for anisotropic temperature factor of the atom.

getAtomGroup()

Returns associated atom group.

getBeta()

Return β-value (temperature factor) of the atom. β-value can be used in atom selections, e.g. 'beta 555.55', 'beta 0 to 500', 'beta 0:500', 'beta < 500'.

getBonds()

Returns bonds. Use setBonds() or inferBonds() from parent AtomGroup for setting bonds.

getCSLabels()

Returns coordinate set labels.

getCharge()

Return partial charge of the atom. Partial charge can be used in atom selections, e.g. 'charge 1', 'abs(charge) == 1', 'charge < 0'.

getChid()

Return chain identifier of the atom. Chain identifier can be used in atom selections, e.g. 'chain A', 'chid A B C', 'chain _'. Note that chid is a synonym for chain.

getChindex()

Return chain index of the atom. Chain indices are assigned to subsets of atoms with distinct pairs of chain identifier and segment name. Chain indices start from zero, are incremented by one, and are assigned in the order of appearance in AtomGroup instance. Chain index can be used in atom selections, e.g. 'chindex 0'.

getCoords()[source]

Returns a copy of coordinates of the atom from the active coordinate set.

getCoordsets(indices=None)[source]

Returns a copy of coordinate set(s) at given indices.

getData(label)[source]

Returns a copy of data associated with label, if it is present.

getDataLabels(which=None)

Returns data labels. For which='user', return only labels of user provided data.

getDataType(label)

Returns type of the data (i.e. data.dtype) associated with label, or None label is not used.

getElement()

Return element symbol of the atom. Element symbol can be used in atom selections, e.g. 'element C O N'.

getFlag(label)[source]

Returns atom flag.

getFlagLabels(which=None)

Returns flag labels. For which='user', return labels of user or parser (e.g. hetatm) provided flags, for which='all' return all possible Atom Flags labels in addition to those present in the instance.

getFragindex()

Return fragment index of the atom. Fragment indices are assigned to connected subsets of atoms. Bonds needs to be set using AtomGroup.setBonds() or AtomGroup.inferBonds(). Fragment indices start from zero, are incremented by one, and are assigned in the order of appearance in AtomGroup instance. Fragment index can be used in atom selections, e.g. 'fragindex 0', 'fragment 1'. Note that fragment is a synonym for fragindex.

getIcode()

Return insertion code of the atom. Insertion code can be used in atom selections, e.g. 'icode A', 'icode _'.

getIndex()[source]

Returns index of the atom.

getIndices()[source]

Returns index of the atom in an numpy.ndarray.

getMass()

Return mass of the atom. Mass can be used in atom selections, e.g. '12 <= mass <= 13.5'.

getMasses()[source]

get the mass atom.

getName()

Return name of the atom. Name can be used in atom selections, e.g. 'name CA CB'.

getOccupancy()

Return occupancy value of the atom. Occupancy value can be used in atom selections, e.g. 'occupancy 1', 'occupancy > 0'.

getRadius()

Return radius of the atom. Radius can be used in atom selections, e.g. 'radii < 1.5', 'radii ** 2 < 2.3'.

getResindex()

Return residue index of the atom. Residue indices are assigned to subsets of atoms with distinct sequences of residue number, insertion code, chain identifier, and segment name. Residue indices start from zero, are incremented by one, and are assigned in the order of appearance in AtomGroup instance. Residue index can be used in atom selections, e.g. 'resindex 0'.

getResname()

Return residue name of the atom. Residue name can be used in atom selections, e.g. 'resname ALA GLY'.

getResnum()

Return residue number of the atom. Residue number can be used in atom selections, e.g. 'resnum 1 2 3', 'resnum 120A 120B', 'resnum 10 to 20', 'resnum 10:20:2', 'resnum < 10'. Note that resid is a synonym for resnum.

getSecclass()

Return secondary structure class of the atom. Secondary structure class can be used in atom selections, e.g. 'secclass 2', 'secclass -1'.

getSecid()

Return secondary structure identifier of the atom. Secondary structure identifier can be used in atom selections, e.g. 'secid A B', 'secid 1 2'.

getSecindex()

Return secondary structure index of the atom. Secondary structure index can be used in atom selections, e.g. 's', 'e', 'c', 'i', 'n', 'd', 'e', 'x', ' ', '2'.

getSecstr()

Return secondary structure assignment of the atom. Secondary structure assignment can be used in atom selections, e.g. 'secondary H E', 'secstr H E'. Note that secstr is a synonym for secondary.

getSegindex()

Return segment index of the atom. Segment indices are assigned to subsets of atoms with distinct segment names. Segment indices start from zero, are incremented by one, and are assigned in the order of appearance in AtomGroup instance. Segment index can be used in atom selections, e.g. 'segindex 0'.

getSegname()

Return segment name of the atom. Segment name can be used in atom selections, e.g. 'segment PROT', 'segname PROT'. Note that segname is a synonym for segment.

getSelstr()[source]

Returns selection string that will select this atom.

getSequence(**kwargs)

Returns one-letter sequence string for amino acids. When allres keyword argument is True, sequence will include all residues (e.g. water molecules) in the chain and X will be used for non-standard residue names.

getSerial()

Return serial number (from file) of the atom. Serial number can be used in atom selections, e.g. 'serial 1 2 3', 'serial 1 to 10', 'serial 1:10:2', 'serial < 10'.

getTitle()

Returns title of the instance.

getType()

Return type of the atom. Type can be used in atom selections, e.g. 'type CT1 CT2 CT3'.

isDataLabel(label)

Returns True if data associated with label is present.

isFlagLabel(label)

Returns True if flags associated with label are present.

iterAcceptors()

Yield acceptors formed by the atom. Use setAcceptors() for setting acceptors.

iterAngles()

Yield angles formed by the atom. Use setAngles() for setting angles.

iterAtoms()[source]

Yield atoms.

iterBonded()[source]

Yield bonded atoms. Use setBonds() for setting bonds.

iterBonds()[source]

Yield bonds formed by the atom. Use setBonds() for setting bonds.

iterCoordsets()[source]

Yield copies of coordinate sets.

iterCrossterms()

Yield crossterms formed by the atom. Use setCrossterms() for setting crossterms.

iterDihedrals()

Yield dihedrals formed by the atom. Use setDihedrals() for setting dihedrals.

iterDonors()

Yield donors formed by the atom. Use setDonors() for setting donors.

iterImpropers()

Yield impropers formed by the atom. Use setImpropers() for setting impropers.

iterNBExclusions()

Yield nbexclusions formed by the atom. Use setNBExclusions() for setting nbexclusions.

numAtoms(flag=None)[source]

Returns number of atoms, or number of atoms with given flag.

numBonds()[source]

Returns number of bonds formed by this atom. Bonds must be set first using AtomGroup.setBonds().

numCoordsets()

Returns number of coordinate sets.

numResidues()

Returns number of residues.

select(selstr, **kwargs)

Returns atoms matching selstr criteria. See select module documentation for details and usage examples.

setACSIndex(index)

Set coordinates at index active.

setAltloc(data)

Set alternate location indicator of the atom. Alternate location indicator can be used in atom selections, e.g. 'altloc A B', 'altloc _'.

setAnisou(anisou)[source]

Set anisotropic temperature factors of the atom in the active coordinate set.

setAnistd(data)

Set standard deviations for anisotropic temperature factor of the atom.

setBeta(data)

Set β-value (temperature factor) of the atom. β-value can be used in atom selections, e.g. 'beta 555.55', 'beta 0 to 500', 'beta 0:500', 'beta < 500'.

setCharge(data)

Set partial charge of the atom. Partial charge can be used in atom selections, e.g. 'charge 1', 'abs(charge) == 1', 'charge < 0'.

setChid(data)

Set chain identifier of the atom. Chain identifier can be used in atom selections, e.g. 'chain A', 'chid A B C', 'chain _'. Note that chid is a synonym for chain.

setCoords(coords)[source]

Set coordinates of the atom in the active coordinate set.

setData(label, data)[source]

Update data associated with label.

Raises:AttributeError – when label is not in use or read-only
setElement(data)

Set element symbol of the atom. Element symbol can be used in atom selections, e.g. 'element C O N'.

setFlag(label, value)[source]

Update flag associated with label.

Raises:AttributeError – when label is not in use or read-only
setIcode(data)

Set insertion code of the atom. Insertion code can be used in atom selections, e.g. 'icode A', 'icode _'.

setMass(data)

Set mass of the atom. Mass can be used in atom selections, e.g. '12 <= mass <= 13.5'.

setName(data)

Set name of the atom. Name can be used in atom selections, e.g. 'name CA CB'.

setOccupancy(data)

Set occupancy value of the atom. Occupancy value can be used in atom selections, e.g. 'occupancy 1', 'occupancy > 0'.

setRadius(data)

Set radius of the atom. Radius can be used in atom selections, e.g. 'radii < 1.5', 'radii ** 2 < 2.3'.

setResname(data)

Set residue name of the atom. Residue name can be used in atom selections, e.g. 'resname ALA GLY'.

setResnum(data)

Set residue number of the atom. Residue number can be used in atom selections, e.g. 'resnum 1 2 3', 'resnum 120A 120B', 'resnum 10 to 20', 'resnum 10:20:2', 'resnum < 10'. Note that resid is a synonym for resnum.

setSecclass(data)

Set secondary structure class of the atom. Secondary structure class can be used in atom selections, e.g. 'secclass 2', 'secclass -1'.

setSecid(data)

Set secondary structure identifier of the atom. Secondary structure identifier can be used in atom selections, e.g. 'secid A B', 'secid 1 2'.

setSecindex(data)

Set secondary structure index of the atom. Secondary structure index can be used in atom selections, e.g. 's', 'e', 'c', 'i', 'n', 'd', 'e', 'x', ' ', '2'.

setSecstr(data)

Set secondary structure assignment of the atom. Secondary structure assignment can be used in atom selections, e.g. 'secondary H E', 'secstr H E'. Note that secstr is a synonym for secondary.

setSegname(data)

Set segment name of the atom. Segment name can be used in atom selections, e.g. 'segment PROT', 'segname PROT'. Note that segname is a synonym for segment.

setSerial(data)

Set serial number (from file) of the atom. Serial number can be used in atom selections, e.g. 'serial 1 2 3', 'serial 1 to 10', 'serial 1:10:2', 'serial < 10'.

setType(data)

Set type of the atom. Type can be used in atom selections, e.g. 'type CT1 CT2 CT3'.

toAtomGroup()

Returns a copy of atoms (and atomic data) in an AtomGroup instance.

toBioPythonStructure(header=None, **kwargs)

Returns a Bio.PDB.Structure object

Parameters:
  • atoms (Atomic) – an object with atom and coordinate data
  • csets – coordinate set indices, default is all coordinate sets
toTEMPyAtom()[source]

Returns a TEMPy BioPyAtom or Structure object as appropriate

toTEMPyAtoms()

Returns a TEMPy.protein.prot_rep_biopy.Atom or list of them as appropriate

toTEMPyStructure()

Returns a protein.prot_rep_biopy.Structure object