Planar classes#
Base class for planar analysis.
- class maicos.core.planar.PlanarBase(atomgroups, dim, zmin, zmax, bin_width, **kwargs)[source]#
Bases:
AnalysisBase
Analysis class providing options and attributes for planar system.
- Parameters:
atomgroups (Atomgroup or list[Atomgroup]) – Atomgroups taken for the Analysis
refgroup (AtomGroup) –
Reference
AtomGroup
used for the calculation.If refgroup is provided, the calculation is performed relative to the center of mass of the AtomGroup.
If refgroup is
None
the calculations are performed to the center of the (changing) box.unwrap (bool) –
When
unwrap = True
, molecules that are broken due to the periodic boundary conditions are made whole.If the input contains molecules that are already whole, speed up the calculation by disabling unwrap. To do so, use the flag
-no-unwrap
when using MAICoS from the command line, or useunwrap = False
when using MAICoS from the Python interpreter.Note: Molecules containing virtual sites (e.g. TIP4P water models) are not currently supported in MDAnalysis. In this case, you need to provide unwrapped trajectory files directly, and disable unwrap. Trajectories can be unwrapped, for example, using the
trjconv
command of GROMACS.concfreq (int) – When concfreq (for conclude frequency) is larger than 0, the conclude function is called and the output files are written every concfreq frames
dim (int) – Dimension for binning (
x=0
,y=1
,z=2
).zmin (float) –
Minimal coordinate for evaluation (in Å) with respect to the center of mass of the refgroup.
If
zmin=None
, all coordinates down to the lower cell boundary are taken into account.zmax (float) –
Maximal coordinate for evaluation (in Å) with respect to the center of mass of the refgroup.
If
zmax = None
, all coordinates up to the upper cell boundary are taken into account.jitter (float) –
If
jitter is not None
, random numbers of the order of jitter (Å) are added to the atom positions.The appilication of a jitter is rationalized in possible aliasing effects when histogramming data, i.e., for spatial profiles. These aliasing effects can be stabilized with the application of a numerical jitter. The jitter value should be about the precision of the trajectory and will not alter the results of the histogram.
You can estimate the precision of the positions in your trajectory with
maicos.lib.util.trajectory_precision()
. Note that if the precision is not the same for all frames, the smallest precision should be used.bin_width (float) – Width of the bins (in Å).
kwargs (dict) – Parameters parsed to AnalysisBase.
- results.bin_pos#
Bin positions (in Å) ranging from
zmin
tozmax
.- Type:
- zmin#
Minimal coordinate for evaluation (Å) with in the lab frame, where 0 corresponds to the origin of the cell.
- Type:
- zmax#
Maximal coordinate for evaluation (Å) with in the lab frame, where 0 corresponds to the origin of the cell.
- Type:
- _obs.bin_pos#
Central bin positions (in Å) of each bin (in Å) in the current frame.
- Type:
numpy.ndarray, (n_bins)
- _obs.bin_edges#
Edges of the bins (in Å) in the current frame.
- Type:
numpy.ndarray, (n_bins + 1)
- _obs.bin_area#
Area of the rectangle of each bin in the current frame. Calculated via \(L_x \cdot L_y / N_\mathrm{bins}\) where \(L_x\) and \(L_y\) are the box lengths perpendicular to the dimension of evaluations given by dim. \(N_\mathrm{bins}\) is the number of bins.
- Type:
numpy.ndarray, (n_bins)
- results.bin_volume#
Volume of an cuboid of each bin (in Å^3) in the current frame.
- Type:
numpy.ndarray, (n_bins)
- property odims#
Other dimensions perpendicular to dim i.e. (0,2) if dim = 1.
- class maicos.core.planar.ProfilePlanarBase(weighting_function, normalization, atomgroups, sym, grouping, bin_method, output, f_kwargs=None, **kwargs)[source]#
Bases:
PlanarBase
,ProfileBase
Base class for computing profiles in a cartesian geometry.
- Parameters:
weighting_function (callable) – The function calculating the array weights for the histogram analysis. It must take an Atomgroup as first argument and a grouping (‘atoms’, ‘residues’, ‘segments’, ‘molecules’, ‘fragments’) as second. Additional parameters can be given as f_kwargs. The function must return a numpy.ndarray with the same length as the number of group members.
normalization (str {'None', 'number', 'volume'}) – The normalization of the profile performed in every frame. If None no normalization is performed. If number the histogram is divided by the number of occurences in each bin. If volume the profile is divided by the volume of each bin.
f_kwargs (dict) – Additional parameters for function
atomgroups (list[AtomGroup]) – a list of
AtomGroup
objects for which the calculations are performed.refgroup (AtomGroup) –
Reference
AtomGroup
used for the calculation.If refgroup is provided, the calculation is performed relative to the center of mass of the AtomGroup.
If refgroup is
None
the calculations are performed to the center of the (changing) box.unwrap (bool) –
When
unwrap = True
, molecules that are broken due to the periodic boundary conditions are made whole.If the input contains molecules that are already whole, speed up the calculation by disabling unwrap. To do so, use the flag
-no-unwrap
when using MAICoS from the command line, or useunwrap = False
when using MAICoS from the Python interpreter.Note: Molecules containing virtual sites (e.g. TIP4P water models) are not currently supported in MDAnalysis. In this case, you need to provide unwrapped trajectory files directly, and disable unwrap. Trajectories can be unwrapped, for example, using the
trjconv
command of GROMACS.concfreq (int) – When concfreq (for conclude frequency) is larger than 0, the conclude function is called and the output files are written every concfreq frames
dim (int) – Dimension for binning (
x=0
,y=1
,z=2
).zmin (float) –
Minimal coordinate for evaluation (in Å) with respect to the center of mass of the refgroup.
If
zmin=None
, all coordinates down to the lower cell boundary are taken into account.zmax (float) –
Maximal coordinate for evaluation (in Å) with respect to the center of mass of the refgroup.
If
zmax = None
, all coordinates up to the upper cell boundary are taken into account.jitter (float) –
If
jitter is not None
, random numbers of the order of jitter (Å) are added to the atom positions.The appilication of a jitter is rationalized in possible aliasing effects when histogramming data, i.e., for spatial profiles. These aliasing effects can be stabilized with the application of a numerical jitter. The jitter value should be about the precision of the trajectory and will not alter the results of the histogram.
You can estimate the precision of the positions in your trajectory with
maicos.lib.util.trajectory_precision()
. Note that if the precision is not the same for all frames, the smallest precision should be used.bin_width (float) – Width of the bins (in Å).
sym (bool) – Symmetrize the profile. Only works in combinations with
refgroup
.grouping (str {
'atoms'
,'residues'
,'segments'
,'molecules'
,'fragments'
}) –Atom grouping for the calculations of profiles.
The possible grouping options are the atom positions (in the case where
grouping='atoms'
) or the center of mass of the specified grouping unit (in the case wheregrouping='residues'
,'segments'
,'molecules'
or'fragments'
).bin_method (str {
'cog'
,'com'
,'coc'
}) –Method for the position binning.
The possible options are center of geometry (
cog
), center of mass (com
), and center of charge (coc
).output (str) – Output filename.
f_kwargs – Additional parameters for function
- results.bin_pos#
Bin positions (in Å) ranging from
zmin
tozmax
.- Type:
- results.profile#
Calculated profile.
- Type:
- results.dprofile#
Estimated profile’s uncertainity.
- Type: