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:
MetricCoordinateCreates 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|ndarray|None) – Atom selection for the atoms whose fluctuations we want to calculate (a selection string, boolean mask, or integer index array). See more hererefmol (
Molecule|None) – 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|ndarray) – Atom selection for the trajectories from which to align to the reference structure (a selection string, boolean mask, or integer index array). See more hererefalnsel (
str|ndarray|None) – Atom selection for refmol from which to align to the reference structure (a selection string, boolean mask, or integer index array). If None, it defaults to the same as trajalnsel. See more herecentersel (
str|ndarray) – Atom selection around which to wrap the simulation (a selection string, boolean mask, or integer index array). See more herepbc (
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)