moleculekit.projections.metricfluctuation module#

class moleculekit.projections.metricfluctuation.MetricFluctuation(atomsel, refmol=None, trajalnsel='protein and name CA', refalnsel=None, centersel='protein', pbc=True, mode='atom')#

Bases: MetricCoordinate

Creates a MetricFluctuation object that calculates the squared fluctuation of atom positions in trajectories.

Depending on the refmol option the projection either returns the fluctuation from the mean position of the atoms, or from coordinates of reference given in refmol. This means it calculates for atom coordinates (x,y,z) and reference coordinates (xr, yr, yz): (xr-x)**2+(yr-y)**2+(zr-z)**2. If groupsel is set to residue it will calculate the mean of this value over all atoms of the residue. To then get the RMSD you need to compute the square root (of the mean) of the results this projection returns over the desired atoms.

Parameters:
  • atomsel (str) – Atom selection string for the atoms whose fluctuations we want to calculate. See more here

  • refmol (Molecule object) – If refmol is None, MetricFluctuation will calculate the fluctuation of the atoms/residues around the trajectory mean. If a refmol is given, it will calculate the fluctuation around the reference atom positions after aligning.

  • trajalnsel (str, optional) – Atom selection string for the trajectories from which to align to the reference structure. See more here

  • refalnsel (str, optional) – Atom selection string for refmol from which to align to the reference structure. If None, it defaults to the same as trajalnsel. See more here

  • centersel (str, optional) – Atom selection string around which to wrap the simulation. See more here

  • pbc (bool) – Enable or disable coordinate wrapping based on periodic boundary conditions.

  • mode (str) – Set to ‘atom’ to get the fluctuation per atom. Set to ‘residue’ to get the mean fluctuation of the residue by grouping all of its atoms given in atomsel

Returns:

metr

Return type:

MetricFluctuation object

Examples

Calculate the fluctuation of atoms wrt their mean positions >>> MetricFluctuation(‘protein and name CA’).project(mol) Calculate the fluctuation of atoms wrt the reference structure >>> MetricFluctuation(‘protein and name CA’, refmol).project(mol) Calculate the fluctuation of residues wrt their mean positions >>> MetricFluctuation(‘protein’, mode=’residue’).project(mol) Calculate the fluctuation of residues wrt the reference structure >>> MetricFluctuation(‘protein’, refmol, mode=’residue’).project(mol)

getMapping(mol)#

Returns the description of each projected dimension.

Parameters:

mol (Molecule object) – A Molecule object which will be used to calculate the descriptions of the projected dimensions.

Returns:

map – A DataFrame containing the descriptions of each dimension

Return type:

DataFrame object

project(mol)#

Project molecule.

Parameters:

mol (Molecule) – A Molecule object to project.

Returns:

data – An array containing the projected data.

Return type:

np.ndarray