Computing the MDDF

Minimum-Distance Distribution Function

The main function of the ComplexMixtures package actually computes the MDDF between the solute and the solvent chosen.

ComplexMixtures.mddfFunction
mddf(
    trajectory::Trajectory, 
    options::Options; 
    frame_weights = Float64[], 
    coordination_number_only = false,
    low_memory = false,
)

Computes the minimum-distance distribution function, atomic contributions, and KB integrals, given the Trajectory structure of the simulation and, optionally, parameters given as a second argument of the Options type. This is the main function of the ComplexMixtures package.

The options parameter is optional. If not set, the default Options() structure will be used.

Optional execution keywords

The frame_weights keyword is an array of weights for each frame of the trajectory. If this is provided, the MDDF will be computed as a weighted average of the MDDFs of each frame. This can be used to study the solvation dependency in perturbed ensembles.

The coordination_number_only, is a boolean that, if set to true, will compute only the site-counts and coordination numbers of the solvent molecules around the solute, and not the MDDF, RDF, or KB integrals. This is useful when the normalization of the distribution is not possible or needed, for instance when the bulk solutio is not properly defined. The computation is much faster in this case.

The low_memory can be set to true to reduce the memory requirements of the computation. This will parallelize the computation of the minimum distances at a lower level, reducing the memory requirements at the expense of some performance.

Compat

The low_memory option was introduced in v2.4.0.

Examples

julia> using ComplexMixtures, PDBTools

julia> using ComplexMixtures.Testing: data_dir

julia> dir = "$data_dir/NAMD";

julia> atoms = readPDB("$dir/structure.pdb");

julia> solute = AtomSelection(select(atoms, "protein"), nmols=1);

julia> solvent = AtomSelection(select(atoms, "resname TMAO"), natomspermol=14);

julia> trajectory = Trajectory("$dir/trajectory.dcd",solute,solvent);

julia> options = Options(lastframe=10, bulk_range=(10.0, 15.0));

julia> results = mddf(trajectory, options)
source

The mddf functions is run with, for example:

results = mddf(trajectory, Options(bulk_range=(10.0, 15.0)))  

The MDDF along with other results, like the corresponding KB integrals, are returned in the results data structure, which is described in the next section.

It is possible to tune several options of the calculation, by setting the Options data structure with user-defined values in advance. The most common parameters to be set by the user are bulk_range and stride.

stride defines if some frames will be skip during the calculation (for speedup). For example, if stride=5, only one in five frames will be considered. Adjust stride with:

options = Options(stride=5, bulk_range=(10.0, 15.0))
results = mddf(trajectory, options)
Note

bulk_range defines the subset of the system, as defined according to a range of distances from the solute, that are to be considered as the bulk solution. Within this range of distances, the user believes that the reference solute molecule does not significantly affect anymore the structure of the solvent.

By default, all molecules above 10 Angstroms from the solute are considered bulk molecules (corresponding to Options(dbulk=10.0)), but it is highly recommended to use a manual definition of bulk_range.

The definition of a range of distances within the system to compute the bulk density is adequate because this system subset is then an open system with a solvent molecule reservoir. The adequate choice of bulk_range can be inspected by the proper convergence of the distribution functions (which must converge to 1.0) and a proper convergence of the KB integrals.

The bulk_range option was introduced in version 2.1.0.

See the Options section for further details and other options to set.

Coordination numbers only

The coordination_number function, called with the same arguments as the mddf function, can be used to compute coordination numbers without the normalization required for the MDDF:

ComplexMixtures.coordination_numberMethod
coordination_number(
    trajectory::Trajectory, options::Options;
    kargs...
)

Computes the coordination numbers for each solute molecule in the trajectory, given the Trajectory. This is an auxiliary function of the ComplexMixtures package, which is used to compute coordination numbers when the normalization of the distribution is not possible or needed.

The output is a Result structure, which contains the data as the result of a call to mddf, except that all counters which require normalization of the distribution will be zero. In summary, this result data structure can be used to compute the coordination numbers, but not the MDDF, RDF, or KB integrals.

The keyword arguments are the same as for the mddf function, and are passed to it. This function is a wrapper around mddf with the coordination_number_only keyword set to true.

source

This function can be useful if the normalization is not possible or meaningful. The computation is much faster if the normalization is not necessary.

Note

The mddf, kb, and random count parameters will be empty when using this options, and are meaningless.