VolMapDensity

Classes

class VolMapDensity.WaterVolNumberDensity(data, protSel='protein', watSel='water', frames=None, nbrVox=32)

This class defines methods to compute volumetric map of number density of selected atoms. Additional methods to plot a distribution and related entropy are available.

Parameters:
  • data – a Dataset class instance containing trajectories data
  • protSel – selection of protein atoms to be used for calculations
  • watSel – water selection for which number of atoms in each voxel will be computed for each selected frame. If within keyword is used, it should be preceded by a bound to keyword to avoid errors in computations.
  • frames – frames to be used to compute number density
  • nbrVox – number of voxel in each dimension to be used
generateVolMap(align=False)

This method computes, for each frame the number density of selected atom in each voxel of the volumetric map.

Parameters:
  • nbrBins – number of bins to be used to compute the histograms
  • align – if True, all atoms will be aligned for each frame, taking the first frame as reference set. Else, only center of mass of selected atoms are aligned.
getDistribution(nbrBins=100, minN=0)

Computes the ditribution of water molecule number in volumetric map.

Parameters:
  • nbrBins – number of bins to be used to computes histogram
  • minN – minimum limit on volumetric map values, only voxels containing values higher than given one will be used.
plotDistribution(nbrBins=100, minN=0, kwargs={'lw': 1})

Plots the distribution of density for all voxel having a value higher than 0.

Parameters:
  • frames – frames to be used in histList attribute for plotting, if multiple frames are selected, the average is returned. This argument should be an integer, a list or a range.
  • minN – minimum limit on volumetric map values, only voxels containing values higher than given one will be used.
  • kwargs – additional keywords arguments to give to matplotlib plot and fill_between functions
writeVolMap(fileName=None, frame=0, pFrames=None)

Write the volumetric map containing water density.

The file is in the APBS .dx format style, so that it can be imported directly into VMD. Moreover, a pdb file is also generated containing frame averaged coordinates for aligned protein.

Parameters:
  • fileName – file name for .pdb and .dx files. If none, the name of the loaded .psf file is used.
  • frame – frame to be used to generate the pdb file
  • pFrames – if not None, this will be used instead for protein frame selection and the resulting coordinates will be an average over all selected frames