From 5b51ffb4ca2a262db9299bfa9a708d84726dc0eb Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 15 Feb 2024 12:13:05 +0000 Subject: [PATCH] build based on 671b5dc --- dev/.documenter-siteinfo.json | 2 +- dev/contrib/index.html | 2 +- dev/example1/index.html | 2 +- dev/example2/index.html | 2 +- dev/example3/index.html | 2 +- dev/example4/index.html | 2 +- dev/examples/index.html | 2 +- dev/index.html | 2 +- dev/installation/index.html | 2 +- dev/mddf/index.html | 4 ++-- dev/multiple/index.html | 2 +- dev/options/index.html | 2 +- dev/parallel/index.html | 2 +- dev/python/index.html | 2 +- dev/quickguide/index.html | 2 +- dev/references/index.html | 2 +- dev/results/index.html | 2 +- dev/save/index.html | 2 +- dev/selection/index.html | 14 +++++++------- dev/tools/index.html | 8 ++++---- dev/trajectory/index.html | 2 +- dev/updating_scripts/index.html | 2 +- 22 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index b40b2821..5f2a32b7 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-02-15T12:11:30","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.1","generation_timestamp":"2024-02-15T12:12:58","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/contrib/index.html b/dev/contrib/index.html index 3f41e24a..869bf74d 100644 --- a/dev/contrib/index.html +++ b/dev/contrib/index.html @@ -43,4 +43,4 @@ julia> results = load(dir*"/protein_EMI.json"); # load pre-calculated results julia> contributions(results, SoluteGroup(["CA", "CB"])) # contribution of CA and CB atoms to the MDDF -source +source diff --git a/dev/example1/index.html b/dev/example1/index.html index 879520d3..54a2fbcc 100644 --- a/dev/example1/index.html +++ b/dev/example1/index.html @@ -181,4 +181,4 @@

In the figure on the left, the points in space around the protein are selected with the following properties: distance from the protein smaller than 2.0Å and relative contribution to the MDDF at the corresponding distance of at least 10% of the maximum contribution. Thus, we are selecting the regions of the protein corresponding to the most stable hydrogen-bonding interactions. The color of the points is the contribution to the MDDF, from blue to red. Thus, the most reddish-points corresponds to the regions where the most stable hydrogen bonds were formed. We have marked two regions here, on opposite sides of the protein, with arrows.

Clicking on those points we obtain which are the atoms of the protein contributing to the MDDF at that region. In particular, the arrow on the right points to the strongest red region, which corresponds to an Aspartic acid. These residues are shown explicitly under the density (represented as a transparent surface) on the figure in the center.

The figure on the right displays, overlapped with the hydrogen-bonding residues, the most important contributions to the second peak of the distribution, corresponding to distances from the protein between 2.0 and 3.5Å. Notably, the regions involved are different from the ones forming hydrogen bonds, indicating that non-specific interactions with the protein (and not a second solvation shell) are responsible for the second peak.

How to run this example:

Assuming that the input files are available in the script directory, just run the script with:

julia density3D.jl

Alternatively, open Julia and copy/paste or the commands in density3D.jl or use include("./density3D.jl"). These options will allow you to remain on the Julia section with access to the grid data structure that was generated and corresponds to the output grid.pdb file.

This will create the grid.pdb file. Here we provide a previously setup VMD session that contains the data with the visualization choices used to generate the figure above. Load it with:

vmd -e grid.vmd

A short tutorial video showing how to open the input and output PDB files in VMD and produce images of the density is available here:

-
+ diff --git a/dev/example2/index.html b/dev/example2/index.html index 9feccb82..363b2b3b 100644 --- a/dev/example2/index.html +++ b/dev/example2/index.html @@ -245,4 +245,4 @@ savefig("./map2D_acr.png") println("Plot saved to map2D_acr.png")

Output

The terminal methyl groups interact strongly with DMF, and strong local density augmentations are visible in particular on the amine groups. These occur at less than 2.0Angs and are characteristic of hydrogen-bond interactions. Interestingly, the DMF molecules are excluded from the aliphatic and carbonyl groups of the polymer, relative to the other groups.

Finally, it is noticeable that the central mer is more weakly solvated by DMF than the mers approaching the extremes of the polymer chain. This is likely a result of the partial folding of the polymer, that protects that central mers from the solvent in a fraction of the polymer configurations.

-

References

Molecules built with JSME: B. Bienfait and P. Ertl, JSME: a free molecule editor in JavaScript, Journal of Cheminformatics 5:24 (2013) http://biomodel.uah.es/en/DIY/JSME/draw.en.htm

The system was built with Packmol.

The simulations were perfomed with NAMD, with CHARMM36 parameters.

+

References

Molecules built with JSME: B. Bienfait and P. Ertl, JSME: a free molecule editor in JavaScript, Journal of Cheminformatics 5:24 (2013) http://biomodel.uah.es/en/DIY/JSME/draw.en.htm

The system was built with Packmol.

The simulations were perfomed with NAMD, with CHARMM36 parameters.

diff --git a/dev/example3/index.html b/dev/example3/index.html index 39c6c399..f9949ab1 100644 --- a/dev/example3/index.html +++ b/dev/example3/index.html @@ -510,4 +510,4 @@ annotate!( 12, 2.7, text("Palmitoyl", :left, 12, plot_font), subplot=2) savefig("POPC_water_chains.png") -println("The plot was saved as POPC_water_chains.png")

./assets/scripts/example3/POPC_ethanol_chains.png

Ethanol displays an important density augmentation at the vicinity of the carbonyl that follows the glycerol group, and accumulates on the proximity of the aliphatic chain. The density of ethanol decreases as one advances into the aliphatic chain, displaying a minimum around the insaturation in the Oleoyl chain. The terminal methyl group of both chains display a greater solvation by ethanol, suggesting the twisting of the aliphatic chain expose these terminal groups to membrane depth where ethanol is already abundant.

The equivalent maps for water are strikingly different, and show that water is excluded from the interior of the membrane:

./assets/scripts/example3/POPC_water_chains.png

References

Membrane built with the VMD membrane plugin.

Water and ethanol layers added with Packmol.

The simulations were performed with NAMD, with CHARMM36 parameters.

Density of the ethanol-water mixture from: https://wissen.science-and-fun.de/chemistry/chemistry/density-tables/ethanol-water-mixtures/

+println("The plot was saved as POPC_water_chains.png")

./assets/scripts/example3/POPC_ethanol_chains.png

Ethanol displays an important density augmentation at the vicinity of the carbonyl that follows the glycerol group, and accumulates on the proximity of the aliphatic chain. The density of ethanol decreases as one advances into the aliphatic chain, displaying a minimum around the insaturation in the Oleoyl chain. The terminal methyl group of both chains display a greater solvation by ethanol, suggesting the twisting of the aliphatic chain expose these terminal groups to membrane depth where ethanol is already abundant.

The equivalent maps for water are strikingly different, and show that water is excluded from the interior of the membrane:

./assets/scripts/example3/POPC_water_chains.png

References

Membrane built with the VMD membrane plugin.

Water and ethanol layers added with Packmol.

The simulations were performed with NAMD, with CHARMM36 parameters.

Density of the ethanol-water mixture from: https://wissen.science-and-fun.de/chemistry/chemistry/density-tables/ethanol-water-mixtures/

diff --git a/dev/example4/index.html b/dev/example4/index.html index e0cc80c5..dd3ce6f8 100644 --- a/dev/example4/index.html +++ b/dev/example4/index.html @@ -279,4 +279,4 @@ ) savefig("./GlycerolWater_map.png") -println("Plot saved to GlycerolWater_map.png")

The interesting result here is that the $\mathrm{CH}$ group of glycerol is protected from both solvents. There is a strong density augmentation at the vicinity of hydroxyl groups, and the second peak of the MDDFs is clearly associated to interactions with the $\mathrm{CH_2}$ groups.

+println("Plot saved to GlycerolWater_map.png")

The interesting result here is that the $\mathrm{CH}$ group of glycerol is protected from both solvents. There is a strong density augmentation at the vicinity of hydroxyl groups, and the second peak of the MDDFs is clearly associated to interactions with the $\mathrm{CH_2}$ groups.

diff --git a/dev/examples/index.html b/dev/examples/index.html index 668f8c82..c431eb04 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -2,4 +2,4 @@ Examples: · ComplexMixtures.jl

Examples

List of examples

How to run these examples

1 Download and install Julia

To run the scripts, we suggest the following procedure:

  1. Create a directory, for example example1.
  2. Copy the required data files, indicated in each example.
  3. Launch julia in that directory, activate the directory environment, and install the required packages. This is done by launching Julia and executing:
    import Pkg 
     Pkg.activate(".")
     Pkg.add(["ComplexMixtures", "PDBTools", "Plots", "LaTeXStrings, EasyFit"])
    -exit()
  4. Copy the code of each script in to a file, and execute with:
    julia -t auto script.jl
    Alternativelly (and perhaps preferrably), copy line by line the content of the script into the Julia REPL, to follow each step of the calculation. For a more advanced Julia usage, we suggest the VSCode IDE with the Julia Language Support extension.
+exit()
  • Copy the code of each script in to a file, and execute with:
    julia -t auto script.jl
    Alternativelly (and perhaps preferrably), copy line by line the content of the script into the Julia REPL, to follow each step of the calculation. For a more advanced Julia usage, we suggest the VSCode IDE with the Julia Language Support extension.
  • diff --git a/dev/index.html b/dev/index.html index 0bcc6970..251db2c6 100644 --- a/dev/index.html +++ b/dev/index.html @@ -16,4 +16,4 @@
    Preferential interaction parameters obtained for the solvation of a protein by ionic liquids.

    -

    In particular, the plot shows that besides being preferentially excluded from the protein surface at high concentrations in the native state, suggesting protein folding stabilization, the interactions with the protein in the denatured states are stronger, leading to denaturation at all concentrations.

    References

    See also

    Seminar

    Applications

    +

    In particular, the plot shows that besides being preferentially excluded from the protein surface at high concentrations in the native state, suggesting protein folding stabilization, the interactions with the protein in the denatured states are stronger, leading to denaturation at all concentrations.

    References

    See also

    Seminar

    Applications

    diff --git a/dev/installation/index.html b/dev/installation/index.html index f4e1ff81..8384ab90 100644 --- a/dev/installation/index.html +++ b/dev/installation/index.html @@ -11,4 +11,4 @@ using LaTeXStrings # etc ...

    And the script can be run with julia -t auto script.jl (where -t auto allows for multi-threading), or included in julia with julia> include("./scritp.jl"), as described in the next section.

    Tip

    By loading the package with

    using ComplexMixtures

    the most common functions of the package become readily available by their direct name, for example mddf(...).

    If you don't want to bring the functions into the scope of your script, use

    import ComplexMixtures

    Then, the functions of the package are called, for example, using ComplexMixtures.mddf(...). To avoid having to write ComplexMixtures all the time, define an acronym. For example:

    import ComplexMixtures as CM
    -CM.mddf(...)
    +CM.mddf(...) diff --git a/dev/mddf/index.html b/dev/mddf/index.html index 000c2171..2709efa6 100644 --- a/dev/mddf/index.html +++ b/dev/mddf/index.html @@ -5,8 +5,8 @@ julia> results = mddf(trajectory); -julia> coordination_numbers = coordination_number(trajectory);source
    ComplexMixtures.mddfMethod
    mddf(trajectory::Trajectory, options::Options; frame_weights = Float64[], coordination_number_only = false)

    Function that 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.

    Examples

    julia> trajectory = Trajectory("./trajectory.dcd",solute,solvent);
    +julia> coordination_numbers = coordination_number(trajectory);
    source
    ComplexMixtures.mddfMethod
    mddf(trajectory::Trajectory, options::Options; frame_weights = Float64[], coordination_number_only = false)

    Function that 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.

    Examples

    julia> trajectory = Trajectory("./trajectory.dcd",solute,solvent);
     
     julia> results = mddf(trajectory);

    or, to set some custom optional parameter,

    julia> options = Options(lastframe=1000);
     
    -julia> results = mddf(trajectory,options);
    source
    +julia> results = mddf(trajectory,options);source diff --git a/dev/multiple/index.html b/dev/multiple/index.html index 449629e7..e742ab5a 100644 --- a/dev/multiple/index.html +++ b/dev/multiple/index.html @@ -17,4 +17,4 @@ 0.5 0.25 0.25 -

    It is not a bad idea to check if that is what you were expecting.

    +

    It is not a bad idea to check if that is what you were expecting.

    diff --git a/dev/options/index.html b/dev/options/index.html index 94183375..0b5468eb 100644 --- a/dev/options/index.html +++ b/dev/options/index.html @@ -1,3 +1,3 @@ Options · ComplexMixtures.jl

    Options

    There are some options to control what exactly is going to be computed to obtain the MDDF. These options can be defined by the user and passed to the mddf function, using, for example:

    options = Options(lastframe=1000)
    -results = mddf(trajectory,options)

    Frame ranges and histogram properties

    These are common options that the regular user might want to set in their calculation.

    firstframe: Integer, first frame of the trajectory to be considered.

    lastframe: Integer, last frame of the trajectory to be considered.

    stride: Integer, consider every stride frames, that is, if stride=5 only one in five frames will be considered.

    binstep: Real, length of the bin step of the histograms, default = 0.02 Angstroms.

    dbulk: Real, distance from which the solution is to be considered as a bulk solution, that is, where the presence of the solute does not affect the structure of the solution anymore. This parameter is important in particular for systems with a single solute molecule (a protein, for example), where the density of the solvent in the box is not the bulk density of the solvent, which must be computed independently. Default: 10 Angstroms.

    cutoff: Real, the maximum distance to be considered in the construction of histograms. Default: 10 Angstroms.

    usecutoff: true/false: If true, the cutoff distance might be different from dbulk and the density of the solvent in bulk will be estimated from the density within dbulk and cutoff. If false, the density of the solvent is estimated from the density outside dbulk by exclusion. Default: false.

    Lower level options

    These will probably never be set by the user, unless if dealing with some special system (large very large, or very low density system).

    irefatom: Integer, index of the reference atom in the solvent molecule used to compute the shell volumes and domain volumes in the Monte-Carlo volume estimates. The final rdf data is reported for this atom as well. By default, we choose the atom which is closer to the center of coordinates of the molecule, but any choice should be fine.

    n_random_samples: Integer, how many samples of random molecules are generated for each solvent molecule to compute the shell volumes and random MDDF counts. Default: 10. Increase this only if you have short trajectory and want to obtain reproducible results for that short trajectory. For long trajectories (most desirable and common), this value can even be decreased to speed up the calculations.

    seed: Seed for random number generator. If -1, the seed will be generated from the entropy of the system. If your results are dependent on the seed, is is probable that you do not have enough sampling. Mostly used for testing purposes. Two runs are only identical if ran with the same seed and in serial mode.

    StableRNG (::Bool), defaults to false. Use a stable random number generator from the StableRNGs package, to produce identical runs on different architectures and Julia versions. Only used for testing.

    nthreads: How many threads to use. By default, it will be the number of physical cores of the computer.

    lcell: Integer, the cell length of the linked-cell method (actually the cell length is cutoff/lcell). Default: 1.

    GC: Bool, force garbage collection, to avoid memory overflow. Default: true. That this might be required is probably a result of something that can vastly improved in memory management. This may slow down parallel runs significantly if the GC runs too often.

    GC_threshold: Float64, minimum fraction of the total memory of the system required to force a GC run. That is, if GC_threshold=0.1, which is the default, every time the free memory becomes less or equal to 10% of the total memory available, a GC run occurs.

    Frame statistical reweighing

    Compat

    Frame reweighing is available in ComplexMixtures 2.0.0 or greater.

    Most times the weights of each frame of the trajectory are the same, resulting from some standard MD simulation. If, for some reason, the frames have different statistical weights, the weights can be passed to the as an optional parameter frame_weights.

    For example:

    julia> results = mddf(trajectory, options; frame_weights=[0.0, 1.0, 2.0])

    The code above will assign a larger weight to the third frame of the trajectory. These weights are relative (meaning that [0.0, 1.0, 2.0] would produce the same result). What will happen under the hood is that the distance counts of the frames will be multiplied by each frame weight, and normalized for the sum of the weights.

    Important: The length of the frame_weights vector must be at least equal to the number of the last frame read from the trajectory. That is, if lastframe is not set, and all the frames will be read, the length of frame_weights must be equal to the length of the trajectory (the stride parameter will skip the information both of the frames and its weights). If lastframe is set, then the length of frame_weights must be at least lastframe (it can be greater, and further values will be ignored). Importantly, the indices of the elements in frame_weights are assumed to correspond to the indices of the frames in the original trajectory file.

    Compute coordination number only

    For some systems, it may be impossible, or to expensive, to compute the normalization of the minimum-distance distribution function. Nevertheless, the coordination number may still be an interesting information to be retrieved from the simulations. To run the computation to compute coordination numbers only, do:

    julia> results = mddf(trajectory, options; coordination_number_only = true)
    Note

    With coordination_number_only set to true, the arrays associated to MDDFs and KB integrals will be empty in the output data structure.

    ComplexMixtures.OptionsType
    struct Options

    Structure that contains the detailed input options.

    • firstframe::Int64

    • lastframe::Int64

    • stride::Int64

    • irefatom::Int64

    • n_random_samples::Int64

    • binstep::Float64

    • dbulk::Float64

    • cutoff::Float64

    • usecutoff::Bool

    • lcell::Int64

    • GC::Bool

    • GC_threshold::Float64

    • seed::Int64

    • StableRNG::Bool

    • nthreads::Int64

    • silent::Bool

    source
    +results = mddf(trajectory,options)

    Frame ranges and histogram properties

    These are common options that the regular user might want to set in their calculation.

    firstframe: Integer, first frame of the trajectory to be considered.

    lastframe: Integer, last frame of the trajectory to be considered.

    stride: Integer, consider every stride frames, that is, if stride=5 only one in five frames will be considered.

    binstep: Real, length of the bin step of the histograms, default = 0.02 Angstroms.

    dbulk: Real, distance from which the solution is to be considered as a bulk solution, that is, where the presence of the solute does not affect the structure of the solution anymore. This parameter is important in particular for systems with a single solute molecule (a protein, for example), where the density of the solvent in the box is not the bulk density of the solvent, which must be computed independently. Default: 10 Angstroms.

    cutoff: Real, the maximum distance to be considered in the construction of histograms. Default: 10 Angstroms.

    usecutoff: true/false: If true, the cutoff distance might be different from dbulk and the density of the solvent in bulk will be estimated from the density within dbulk and cutoff. If false, the density of the solvent is estimated from the density outside dbulk by exclusion. Default: false.

    Lower level options

    These will probably never be set by the user, unless if dealing with some special system (large very large, or very low density system).

    irefatom: Integer, index of the reference atom in the solvent molecule used to compute the shell volumes and domain volumes in the Monte-Carlo volume estimates. The final rdf data is reported for this atom as well. By default, we choose the atom which is closer to the center of coordinates of the molecule, but any choice should be fine.

    n_random_samples: Integer, how many samples of random molecules are generated for each solvent molecule to compute the shell volumes and random MDDF counts. Default: 10. Increase this only if you have short trajectory and want to obtain reproducible results for that short trajectory. For long trajectories (most desirable and common), this value can even be decreased to speed up the calculations.

    seed: Seed for random number generator. If -1, the seed will be generated from the entropy of the system. If your results are dependent on the seed, is is probable that you do not have enough sampling. Mostly used for testing purposes. Two runs are only identical if ran with the same seed and in serial mode.

    StableRNG (::Bool), defaults to false. Use a stable random number generator from the StableRNGs package, to produce identical runs on different architectures and Julia versions. Only used for testing.

    nthreads: How many threads to use. By default, it will be the number of physical cores of the computer.

    lcell: Integer, the cell length of the linked-cell method (actually the cell length is cutoff/lcell). Default: 1.

    GC: Bool, force garbage collection, to avoid memory overflow. Default: true. That this might be required is probably a result of something that can vastly improved in memory management. This may slow down parallel runs significantly if the GC runs too often.

    GC_threshold: Float64, minimum fraction of the total memory of the system required to force a GC run. That is, if GC_threshold=0.1, which is the default, every time the free memory becomes less or equal to 10% of the total memory available, a GC run occurs.

    Frame statistical reweighing

    Compat

    Frame reweighing is available in ComplexMixtures 2.0.0 or greater.

    Most times the weights of each frame of the trajectory are the same, resulting from some standard MD simulation. If, for some reason, the frames have different statistical weights, the weights can be passed to the as an optional parameter frame_weights.

    For example:

    julia> results = mddf(trajectory, options; frame_weights=[0.0, 1.0, 2.0])

    The code above will assign a larger weight to the third frame of the trajectory. These weights are relative (meaning that [0.0, 1.0, 2.0] would produce the same result). What will happen under the hood is that the distance counts of the frames will be multiplied by each frame weight, and normalized for the sum of the weights.

    Important: The length of the frame_weights vector must be at least equal to the number of the last frame read from the trajectory. That is, if lastframe is not set, and all the frames will be read, the length of frame_weights must be equal to the length of the trajectory (the stride parameter will skip the information both of the frames and its weights). If lastframe is set, then the length of frame_weights must be at least lastframe (it can be greater, and further values will be ignored). Importantly, the indices of the elements in frame_weights are assumed to correspond to the indices of the frames in the original trajectory file.

    Compute coordination number only

    For some systems, it may be impossible, or to expensive, to compute the normalization of the minimum-distance distribution function. Nevertheless, the coordination number may still be an interesting information to be retrieved from the simulations. To run the computation to compute coordination numbers only, do:

    julia> results = mddf(trajectory, options; coordination_number_only = true)
    Note

    With coordination_number_only set to true, the arrays associated to MDDFs and KB integrals will be empty in the output data structure.

    ComplexMixtures.OptionsType
    struct Options

    Structure that contains the detailed input options.

    • firstframe::Int64

    • lastframe::Int64

    • stride::Int64

    • irefatom::Int64

    • n_random_samples::Int64

    • binstep::Float64

    • dbulk::Float64

    • cutoff::Float64

    • usecutoff::Bool

    • lcell::Int64

    • GC::Bool

    • GC_threshold::Float64

    • seed::Int64

    • StableRNG::Bool

    • nthreads::Int64

    • silent::Bool

    source
    diff --git a/dev/parallel/index.html b/dev/parallel/index.html index 3385980c..bd0ae988 100644 --- a/dev/parallel/index.html +++ b/dev/parallel/index.html @@ -1,4 +1,4 @@ Parallel execution · ComplexMixtures.jl

    Parallel execution

    It is highly recommended to run MDDF calculations in parallel, using multiple processors of a single computer. To run the computation in parallel, initialize julia with the -t N option, where N is the number of processes to be used. For example, to use 8 parallel processes, use:

    julia -t 8 example.jl

    The computation will use a number of parallel processes equal to N. Use -t auto to automatically pick the number of threads available in your computer.

    Note

    The number of threads used for computation of the MDDF is the number of threads available to Julia. Many computers allow hyperthreading, and not necessarily this this beneficial for the execution of this package. The optimal number of threads may vary.

    Independently of the number of threads initialized with the -t command-line parameter, the number of processes launched by ComplexMixtures in any given computation can be adjusted by the Options(nthreads=N) option. This won't provide any speedup if the optional number of threads is greater than the number of threads available to Julia at runtime.

    Warning

    If the calculations get Killed by no apparent reason, that is probably because you are running out of memory because of the many parallel computations running. One way to alleviate this problem is to force garbage collection, using

    options = Options(GC=true,GC_threshold=0.5)
     R = mddf(trajectory,options)
    -

    The GC_threshold=0.5 indicates that if the free memory is smaller than 50% of the total memory of the machine, a garbage-collection run will occur. The default parameters are GC=true and GC_threshold=0.3.

    Read the predefinition of atom groups section if you are experiencing memory issues.

    +

    The GC_threshold=0.5 indicates that if the free memory is smaller than 50% of the total memory of the machine, a garbage-collection run will occur. The default parameters are GC=true and GC_threshold=0.3.

    Read the predefinition of atom groups section if you are experiencing memory issues.

    diff --git a/dev/python/index.html b/dev/python/index.html index 60203595..238fe28b 100644 --- a/dev/python/index.html +++ b/dev/python/index.html @@ -83,4 +83,4 @@ plt.legend() plt.xlabel("distance / Angs") plt.ylabel("MDDF") -plt.savefig("group_contributions.png")

    Despite the low sampling, it is clear that hydroxyl groups contribute to the greter peak of the distribution, at hydrogen-bonding distances, as expected. The contributions of the aliphatic groups to the MDDF occurs at longer distances, associated to non-specific interactions.

    Note

    The syntax here diverges from the Julia-only examples by requiring the lists of names to be converted to Julia arrays, which happens by using the cm.list(python_list) function calls.

    +plt.savefig("group_contributions.png")

    Despite the low sampling, it is clear that hydroxyl groups contribute to the greter peak of the distribution, at hydrogen-bonding distances, as expected. The contributions of the aliphatic groups to the MDDF occurs at longer distances, associated to non-specific interactions.

    Note

    The syntax here diverges from the Julia-only examples by requiring the lists of names to be converted to Julia arrays, which happens by using the cm.list(python_list) function calls.

    diff --git a/dev/quickguide/index.html b/dev/quickguide/index.html index f8705b04..e6be6bdd 100644 --- a/dev/quickguide/index.html +++ b/dev/quickguide/index.html @@ -51,4 +51,4 @@

    The Kirkwood-Buff integral corresponding to that distribution is provided in the results.kb vector, and can be also directly plotted with

    plot(results.d, results.kb, xlabel="d / Å", ylabel="KB(d) / L / mol") 

    to obtain:

    -

    See the Atomic and group contributions section for a detailed account on how to obtain a molecular picture of the solvation by splitting the MDDF in the contributions of each type of atom of the solvent, each type of residue of the protein, etc.

    Save the results

    The results can be saved into a file (with JSON format) with:

    save(results, "./results.json")

    And these results can be loaded afterwards with:

    load("./results.json")

    Alternatively, a human-readable set of output files can be obtained to be analyzed in other software (or plotted with alternative tools), with

    write(results,"./results.dat")
    +

    See the Atomic and group contributions section for a detailed account on how to obtain a molecular picture of the solvation by splitting the MDDF in the contributions of each type of atom of the solvent, each type of residue of the protein, etc.

    Save the results

    The results can be saved into a file (with JSON format) with:

    save(results, "./results.json")

    And these results can be loaded afterwards with:

    load("./results.json")

    Alternatively, a human-readable set of output files can be obtained to be analyzed in other software (or plotted with alternative tools), with

    write(results,"./results.dat")
    diff --git a/dev/references/index.html b/dev/references/index.html index 4cbf38d0..7d468eae 100644 --- a/dev/references/index.html +++ b/dev/references/index.html @@ -1,2 +1,2 @@ -References · ComplexMixtures.jl

    References

    Primary citations

    If this package was useful to you, please cite the following papers:

    • L. Martínez, ComplexMixtures.jl: Investigating the structure of solutions of complex-shaped molecules from a solvent-shell perspective. J. Mol. Liq. 347, 117945, 2022. [Full Text]

    • L. Martínez, S. Shimizu, Molecular interpretation of preferential interactions in protein solvation: a solvent-shell perspective by means of minimum-distance distribution functions. J. Chem. Theor. Comp. 13, 6358–6372, 2017. [Full Text]

    Applications and examples

    • A. F. Pereira, V. Piccoli, L. Martínez, Trifluoroethanol direct interactions with protein backbones destabilize alpha-helices. J. Mol. Liq. 365, 120209, 2022. [Full Text]

    • V. Piccoli, L. Martínez, Ionic liquid solvation of proteins in native and denatured states. J. Mol. Liq. 363, 119953, 2022. [Full Text]

    • V. Piccoli, L. Martínez, Correlated counterion effects in the solvation of proteins by ionic-liquids. J. Mol. Liq. 320, 114347, 2020. [Full Text]

    • I. P. de Oliveira, L. Martínez, The shift in urea orientation at protein surfaces at low pH is compatible with a direct mechanism of protein denaturation. Phys. Chem. Chem. Phys. 22, 354-367, 2020. [Full Text]

    • I. P. de Oliveira, L. Martínez, Molecular basis for competitive solvation of the Burkholderia cepacia lipase by sorbitol and urea. Phys. Chem. Chem. Phys. 18, 21797-21808, 2016. [Full Text]

    See also

    • Packmol: A package for building initial configurations for molecular dynamics simulations.

    • CellListMap.jl: Efficient and customizable implementation of cell lists, which allows the computation of general properties dependent on distances of particles within a cutoff, for example short-range potentials, forces, neighbor lists, etc.

    • MDLovoFit: Automatic identification of mobile and rigid substructures in molecular dynamics simulations and fractional structural fluctuation analysis.

    +References · ComplexMixtures.jl

    References

    Primary citations

    If this package was useful to you, please cite the following papers:

    • L. Martínez, ComplexMixtures.jl: Investigating the structure of solutions of complex-shaped molecules from a solvent-shell perspective. J. Mol. Liq. 347, 117945, 2022. [Full Text]

    • L. Martínez, S. Shimizu, Molecular interpretation of preferential interactions in protein solvation: a solvent-shell perspective by means of minimum-distance distribution functions. J. Chem. Theor. Comp. 13, 6358–6372, 2017. [Full Text]

    Applications and examples

    • A. F. Pereira, V. Piccoli, L. Martínez, Trifluoroethanol direct interactions with protein backbones destabilize alpha-helices. J. Mol. Liq. 365, 120209, 2022. [Full Text]

    • V. Piccoli, L. Martínez, Ionic liquid solvation of proteins in native and denatured states. J. Mol. Liq. 363, 119953, 2022. [Full Text]

    • V. Piccoli, L. Martínez, Correlated counterion effects in the solvation of proteins by ionic-liquids. J. Mol. Liq. 320, 114347, 2020. [Full Text]

    • I. P. de Oliveira, L. Martínez, The shift in urea orientation at protein surfaces at low pH is compatible with a direct mechanism of protein denaturation. Phys. Chem. Chem. Phys. 22, 354-367, 2020. [Full Text]

    • I. P. de Oliveira, L. Martínez, Molecular basis for competitive solvation of the Burkholderia cepacia lipase by sorbitol and urea. Phys. Chem. Chem. Phys. 18, 21797-21808, 2016. [Full Text]

    See also

    • Packmol: A package for building initial configurations for molecular dynamics simulations.

    • CellListMap.jl: Efficient and customizable implementation of cell lists, which allows the computation of general properties dependent on distances of particles within a cutoff, for example short-range potentials, forces, neighbor lists, etc.

    • MDLovoFit: Automatic identification of mobile and rigid substructures in molecular dynamics simulations and fractional structural fluctuation analysis.

    diff --git a/dev/results/index.html b/dev/results/index.html index 9d0fe212..4251fef6 100644 --- a/dev/results/index.html +++ b/dev/results/index.html @@ -21,4 +21,4 @@ ⋮ 0.72186381783 1.13624162115

    A typical plot of results.kb as a function of results.d will look like:

    Thus, this plot was obtained with the following code:

    using Plots
    -plot(results.d,results.kb,xlabel="d/A",ylabel="mddf(d) / L/mol") 

    Units

    Warning

    If the coordinates are not in Å, the calculation will proceed normally, but the units of the KB integrals, which has units of volume per mol, should be converted to conform the length unit provided.

    Coordination number and other data

    Obtaining the MDDF involves the computation of some intermediate properties that are frequently useful for additional solution structure analysis. In particular, the coordination numbers are computed. For example, the coordination number as a function from the distance to the solute can be retrieved from a Results data structure with:

    coordination_number = results.coordination_number

    and this data can be plotted against the distances by:

    plot(result.d,results.coordination_number)

    The coordination number of subgroups can also be obtained, as explained in the Coordination number section.

    The complete data available is:

    ParameterMeaningType of valueComment
    dVector of distances of the histograms.Vector{Float64}To be used as the x coordinate on plotting any of the data.
    md_countNon-normalized count of minimum distances at each d.Vector{Float64}This is the number of minimum distances found at each histogram bin, without normalization. Usually this is not interesting to analyze, because it is dependent on the bin size.
    md_count_randomNumber of minimum distances found at each histogram bin for the random distribution.Vector{Float64}This is the normalization required to convert the md_count array into the minimum-distance distribution.
    coordination_numberCumulative number of sites found for each histogram distance.Vector{Float64}This is the coordination number, that is, the number of sites found cumulative up to each distance, without any normalization.
    coordination_number_randomCumulative site count for the random distribution.Vector{Float64}Usually not interesting for analysis.
    mddfThe final distribution function.Vector{Float64}This is the MDDF computed (md_count normalized by md_count_random). It is the main result of the calculation.
    kbThe final Kirkwood-Buff integral.Vector{Float64}This is the final KB integral, as a function of the integration distance from the solute. Computed as coordination_number - coordination_number_random
    solute_atomAtomic contributions of the solute.Matrix{Float64}This is a matrix with nbins lines and solute.natomspermol columns, containing the atomic contributions of each solute atom to the complete MDDF.
    solvent_atomAtomic contributions of the solvent.Matrix{Float64}This is a matrix with nbins lines and solvent.natomspermol columns, containing the atomic contributions of each solvent atom to the complete MDDF.
    density.soluteDensity (concentration) of the solute in the complete simulation box.Float64In units of molecules/$\textrm{\AA}^3$
    density.solventDensity (concentration) of the solvent in the complete simulation box.Float64In units of molecules/$\textrm{\AA}^3$
    density.solvent_bulkDensity (concentration) of the solute in the bulk region.Float64In units of molecules/$\textrm{\AA}^3$
    volumeVolume measures.VolumeContains the total volume of the simulation, the bulk volume, the volume of the solute domain and the shell volume of each bin of the histogram. These are computed by numerical integration from the random distributions.
    filesList of files read.Vector{String}
    weightsWeights of each file in the final counts.Vector{Float64}If the trajectories have different lengths or number of frames, the weights are adapted accordingly.

    Other Result parameters available which are set at Options:

    ParameterMeaningType of valueComment
    nbinsNumber of bins of the histograms.Int
    dbulkDistance from solute of bulk solution.Float64
    cutoffMaximum distance to be considered for histograms.Float64
    autocorrelationThe solute is the same as the solvent?BoolAutomatically set if solute == solvent.
    soluteProperties of the soluteAtomSelectionContains the number of atoms, number of atoms per molecule and number of molecules of the solute.
    solventProperties of the solvent.AtomSelectionContains the number of atoms, number of atoms per molecule and number of molecules of the solvent.
    irefatomThis is a reference atom that is used to generate random rotations and translations internally.IntCounts of the distributions for this atom are performed automatically to obtain radial (or proximal) distribution functions. Can be used for testing purposes.
    rdf_countThis is the md_count minimum distance count of irefatom.Vector{Float64}This corresponds to the conventional radial distribution function if the solute contains only one atom.
    rdf_count_randomMinimum distance of irefatom count for the random distribution.Vector{Float64}
    rdfDistribution function computed from the irefatom distribution. It is a conventional rdf if the solvent has only one atom.Vector{Float64}
    kb_rdfKirkwood-Buff integral computed from the irefatom distribution.Vector{Float64}This must converge, at long distances, to the same value as kb, and can be used for testing.
    optionsCalculation options.OptionsCarries (some redundant) options set by the user.
    lastframe_readLast frame read from the trajectory.Int
    n_frames_readNumber of frames read from the trajectory.IntCan differ from lastframe_read if stride != 1

    Reference functions

    ComplexMixtures.DensityType
    mutable struct Density

    Structure to contain the density values obtained from the calculation.

    • solute::Float64

    • solvent::Float64

    • solvent_bulk::Float64

    source
    ComplexMixtures.ResultType
    mutable struct Result

    Structure to contain the results of the MDDF calculation.

    • Version::VersionNumber

    • nbins::Int64

    • dbulk::Float64

    • cutoff::Float64

    • d::Vector{Float64}

    • md_count::Vector{Float64}

    • md_count_random::Vector{Float64}

    • coordination_number::Vector{Float64}

    • coordination_number_random::Vector{Float64}

    • mddf::Vector{Float64}

    • kb::Vector{Float64}

    • autocorrelation::Bool

    • solute::AtomSelection

    • solvent::AtomSelection

    • solute_group_count::Vector{Vector{Float64}}

    • solvent_group_count::Vector{Vector{Float64}}

    • rdf_count::Vector{Float64}

    • rdf_count_random::Vector{Float64}

    • sum_rdf_count::Vector{Float64}

    • sum_rdf_count_random::Vector{Float64}

    • rdf::Vector{Float64}

    • kb_rdf::Vector{Float64}

    • density::ComplexMixtures.Density

    • volume::ComplexMixtures.Volume

    • files::Vector{ComplexMixtures.TrajectoryFileOptions}

    • weights::Vector{Float64}

    The Result{Vector{Float64}} parametric type is necessary only for reading the JSON3 saved file.

    source
    Base.mergeMethod
    merge(r::Vector{Result})

    This function merges the results of MDDF calculations obtained by running the same analysis on multiple trajectories, or multiple parts of the same trajectory. It returns a Result structure of the same type, with all the functions and counters representing averages of the set provided weighted by the number of frames read in each Result set.

    source
    ComplexMixtures.loadMethod
    load(filename::String)

    Function to load the json saved results file into the Result data structure.

    source
    ComplexMixtures.overviewMethod
    overview(R::Result)

    Function that outputs the volumes and densities in the most natural units.

    source
    ComplexMixtures.saveMethod
    save(R::Result, filename::String)

    Function to write the result data structure to a json file.

    source
    +plot(results.d,results.kb,xlabel="d/A",ylabel="mddf(d) / L/mol")

    Units

    Warning

    If the coordinates are not in Å, the calculation will proceed normally, but the units of the KB integrals, which has units of volume per mol, should be converted to conform the length unit provided.

    Coordination number and other data

    Obtaining the MDDF involves the computation of some intermediate properties that are frequently useful for additional solution structure analysis. In particular, the coordination numbers are computed. For example, the coordination number as a function from the distance to the solute can be retrieved from a Results data structure with:

    coordination_number = results.coordination_number

    and this data can be plotted against the distances by:

    plot(result.d,results.coordination_number)

    The coordination number of subgroups can also be obtained, as explained in the Coordination number section.

    The complete data available is:

    ParameterMeaningType of valueComment
    dVector of distances of the histograms.Vector{Float64}To be used as the x coordinate on plotting any of the data.
    md_countNon-normalized count of minimum distances at each d.Vector{Float64}This is the number of minimum distances found at each histogram bin, without normalization. Usually this is not interesting to analyze, because it is dependent on the bin size.
    md_count_randomNumber of minimum distances found at each histogram bin for the random distribution.Vector{Float64}This is the normalization required to convert the md_count array into the minimum-distance distribution.
    coordination_numberCumulative number of sites found for each histogram distance.Vector{Float64}This is the coordination number, that is, the number of sites found cumulative up to each distance, without any normalization.
    coordination_number_randomCumulative site count for the random distribution.Vector{Float64}Usually not interesting for analysis.
    mddfThe final distribution function.Vector{Float64}This is the MDDF computed (md_count normalized by md_count_random). It is the main result of the calculation.
    kbThe final Kirkwood-Buff integral.Vector{Float64}This is the final KB integral, as a function of the integration distance from the solute. Computed as coordination_number - coordination_number_random
    solute_atomAtomic contributions of the solute.Matrix{Float64}This is a matrix with nbins lines and solute.natomspermol columns, containing the atomic contributions of each solute atom to the complete MDDF.
    solvent_atomAtomic contributions of the solvent.Matrix{Float64}This is a matrix with nbins lines and solvent.natomspermol columns, containing the atomic contributions of each solvent atom to the complete MDDF.
    density.soluteDensity (concentration) of the solute in the complete simulation box.Float64In units of molecules/$\textrm{\AA}^3$
    density.solventDensity (concentration) of the solvent in the complete simulation box.Float64In units of molecules/$\textrm{\AA}^3$
    density.solvent_bulkDensity (concentration) of the solute in the bulk region.Float64In units of molecules/$\textrm{\AA}^3$
    volumeVolume measures.VolumeContains the total volume of the simulation, the bulk volume, the volume of the solute domain and the shell volume of each bin of the histogram. These are computed by numerical integration from the random distributions.
    filesList of files read.Vector{String}
    weightsWeights of each file in the final counts.Vector{Float64}If the trajectories have different lengths or number of frames, the weights are adapted accordingly.

    Other Result parameters available which are set at Options:

    ParameterMeaningType of valueComment
    nbinsNumber of bins of the histograms.Int
    dbulkDistance from solute of bulk solution.Float64
    cutoffMaximum distance to be considered for histograms.Float64
    autocorrelationThe solute is the same as the solvent?BoolAutomatically set if solute == solvent.
    soluteProperties of the soluteAtomSelectionContains the number of atoms, number of atoms per molecule and number of molecules of the solute.
    solventProperties of the solvent.AtomSelectionContains the number of atoms, number of atoms per molecule and number of molecules of the solvent.
    irefatomThis is a reference atom that is used to generate random rotations and translations internally.IntCounts of the distributions for this atom are performed automatically to obtain radial (or proximal) distribution functions. Can be used for testing purposes.
    rdf_countThis is the md_count minimum distance count of irefatom.Vector{Float64}This corresponds to the conventional radial distribution function if the solute contains only one atom.
    rdf_count_randomMinimum distance of irefatom count for the random distribution.Vector{Float64}
    rdfDistribution function computed from the irefatom distribution. It is a conventional rdf if the solvent has only one atom.Vector{Float64}
    kb_rdfKirkwood-Buff integral computed from the irefatom distribution.Vector{Float64}This must converge, at long distances, to the same value as kb, and can be used for testing.
    optionsCalculation options.OptionsCarries (some redundant) options set by the user.
    lastframe_readLast frame read from the trajectory.Int
    n_frames_readNumber of frames read from the trajectory.IntCan differ from lastframe_read if stride != 1

    Reference functions

    ComplexMixtures.DensityType
    mutable struct Density

    Structure to contain the density values obtained from the calculation.

    • solute::Float64

    • solvent::Float64

    • solvent_bulk::Float64

    source
    ComplexMixtures.ResultType
    mutable struct Result

    Structure to contain the results of the MDDF calculation.

    • Version::VersionNumber

    • nbins::Int64

    • dbulk::Float64

    • cutoff::Float64

    • d::Vector{Float64}

    • md_count::Vector{Float64}

    • md_count_random::Vector{Float64}

    • coordination_number::Vector{Float64}

    • coordination_number_random::Vector{Float64}

    • mddf::Vector{Float64}

    • kb::Vector{Float64}

    • autocorrelation::Bool

    • solute::AtomSelection

    • solvent::AtomSelection

    • solute_group_count::Vector{Vector{Float64}}

    • solvent_group_count::Vector{Vector{Float64}}

    • rdf_count::Vector{Float64}

    • rdf_count_random::Vector{Float64}

    • sum_rdf_count::Vector{Float64}

    • sum_rdf_count_random::Vector{Float64}

    • rdf::Vector{Float64}

    • kb_rdf::Vector{Float64}

    • density::ComplexMixtures.Density

    • volume::ComplexMixtures.Volume

    • files::Vector{ComplexMixtures.TrajectoryFileOptions}

    • weights::Vector{Float64}

    The Result{Vector{Float64}} parametric type is necessary only for reading the JSON3 saved file.

    source
    Base.mergeMethod
    merge(r::Vector{Result})

    This function merges the results of MDDF calculations obtained by running the same analysis on multiple trajectories, or multiple parts of the same trajectory. It returns a Result structure of the same type, with all the functions and counters representing averages of the set provided weighted by the number of frames read in each Result set.

    source
    ComplexMixtures.loadMethod
    load(filename::String)

    Function to load the json saved results file into the Result data structure.

    source
    ComplexMixtures.overviewMethod
    overview(R::Result)

    Function that outputs the volumes and densities in the most natural units.

    source
    ComplexMixtures.saveMethod
    save(R::Result, filename::String)

    Function to write the result data structure to a json file.

    source
    diff --git a/dev/save/index.html b/dev/save/index.html index af429f8f..393fab0a 100644 --- a/dev/save/index.html +++ b/dev/save/index.html @@ -3,4 +3,4 @@ R::Result, filename::String; solute_group_names::Vector{String} = R.solute.group_names, solvent_group_names::Vector{String} = R.solvent.group_names, -)

    Function to write the final results to output files as simple tables that are human-readable and easy to analyze with other software

    If the solute and solvent group names are defined in R, the solute_group_names and solvent_group_names arguments are not necessary. If they are not defined, the user can pass the names of the groups as strings in the solute_group_names and solvent_group_names arguments.

    source +)

    Function to write the final results to output files as simple tables that are human-readable and easy to analyze with other software

    If the solute and solvent group names are defined in R, the solute_group_names and solvent_group_names arguments are not necessary. If they are not defined, the user can pass the names of the groups as strings in the solute_group_names and solvent_group_names arguments.

    source diff --git a/dev/selection/index.html b/dev/selection/index.html index 69a4a649..7516592b 100644 --- a/dev/selection/index.html +++ b/dev/selection/index.html @@ -53,7 +53,7 @@ 1436 1437

    With these group selections predefined, the contributions of these groups to the MDDF or coordination numbers can be retrived directly from the result data structure with, for example:

    julia> result = mddf(trajectory, solute, solvent);
     
    -julia> acidic_residue_contributions = contributions(result, SoluteGroup("acidic residues"))

    Reference functions

    ComplexMixtures.AtomSelectionType
    struct AtomSelection

    Structure that contains the information about the solute and solvent molecules.

    • nmols::Int64

    • natomspermol::Int64

    • indices::Vector{Int64}

    • custom_groups::Bool

    • group_atom_indices::Vector{Vector{Int64}}

    • group_names::Vector{String}

    source
    ComplexMixtures.AtomSelectionMethod

    AtomSelection constructors

    The AtomSelection structure carries the information of the molecules that are going to be used to compute the MDDF. The structure can be initialized in different ways:

    1. Initialize the structure providing a vector of PDBTools.Atom(s).
        AtomSelection(
    +julia> acidic_residue_contributions = contributions(result, SoluteGroup("acidic residues"))

    Reference functions

    ComplexMixtures.AtomSelectionType
    struct AtomSelection

    Structure that contains the information about the solute and solvent molecules.

    • nmols::Int64

    • natomspermol::Int64

    • indices::Vector{Int64}

    • custom_groups::Bool

    • group_atom_indices::Vector{Vector{Int64}}

    • group_names::Vector{String}

    source
    ComplexMixtures.AtomSelectionMethod

    AtomSelection constructors

    The AtomSelection structure carries the information of the molecules that are going to be used to compute the MDDF. The structure can be initialized in different ways:

    1. Initialize the structure providing a vector of PDBTools.Atom(s).
        AtomSelection(
             atoms::AbstractVector{<:PDBTools.Atom}; 
             nmols::Int = 0, 
             natomspermol::Int = 0,
    @@ -102,7 +102,7 @@
     AtomSelection 
         3 atoms belonging to 3 molecule(s).
         Atoms per molecule: 1
    -    Number of groups: 2 
    source
    ComplexMixtures.SoluteGroupType

    SoluteGroup and SolventGroup data structures.

    These structures are used to select groups of atoms to extract their contributions from the MDDF results.

    Most tipically, the groups are defined from a selection of atoms with the PDBTools package, or by providing directly the indices of teh atoms in the structure.

    Alternativelly, if the groups were predefined, the groups can be selected by group index or group name.

    The possible constructors are:

    SoluteGroup(atoms::Vector{PDBTools.Atom})
    +    Number of groups: 2 
    source
    ComplexMixtures.SoluteGroupType

    SoluteGroup and SolventGroup data structures.

    These structures are used to select groups of atoms to extract their contributions from the MDDF results.

    Most tipically, the groups are defined from a selection of atoms with the PDBTools package, or by providing directly the indices of teh atoms in the structure.

    Alternativelly, if the groups were predefined, the groups can be selected by group index or group name.

    The possible constructors are:

    SoluteGroup(atoms::Vector{PDBTools.Atom})
     SoluteGroup(atom_indices::Vector{Int})
     SoluteGroup(atom_names::Vector{String})
     SoluteGroup(group_name::String)
    @@ -134,7 +134,7 @@
     julia> SoluteGroup(collect(eachresidue(atoms))[2]) # PDBTools.Residue(s)
     SoluteGroup defined by:
         atom_indices: [ 13, 14, ..., 22, 23 ] - 11 atoms
    -
    source
    ComplexMixtures.SolventGroupType

    SoluteGroup and SolventGroup data structures.

    These structures are used to select groups of atoms to extract their contributions from the MDDF results.

    Most tipically, the groups are defined from a selection of atoms with the PDBTools package, or by providing directly the indices of teh atoms in the structure.

    Alternativelly, if the groups were predefined, the groups can be selected by group index or group name.

    The possible constructors are:

    SoluteGroup(atoms::Vector{PDBTools.Atom})
    +
    source
    ComplexMixtures.SolventGroupType

    SoluteGroup and SolventGroup data structures.

    These structures are used to select groups of atoms to extract their contributions from the MDDF results.

    Most tipically, the groups are defined from a selection of atoms with the PDBTools package, or by providing directly the indices of teh atoms in the structure.

    Alternativelly, if the groups were predefined, the groups can be selected by group index or group name.

    The possible constructors are:

    SoluteGroup(atoms::Vector{PDBTools.Atom})
     SoluteGroup(atom_indices::Vector{Int})
     SoluteGroup(atom_names::Vector{String})
     SoluteGroup(group_name::String)
    @@ -166,7 +166,7 @@
     julia> SoluteGroup(collect(eachresidue(atoms))[2]) # PDBTools.Residue(s)
     SoluteGroup defined by:
         atom_indices: [ 13, 14, ..., 22, 23 ] - 11 atoms
    -
    source
    ComplexMixtures.atom_groupMethod
    atom_group(atsel::AtomSelection, i::Int)
     atom_group(atsel::AtomSelection, groupname::String)
     
     atom_group(atsel::AtomSelection, i::Int)
    @@ -188,7 +188,7 @@
      3
     
     julia> atom_group_name(atsel, 1)
    -"G1"
    source
    ComplexMixtures.atom_group_nameMethod
    atom_group_name(atsel::AtomSelection, i::Int)
     atom_group_names(atsel::AtomSelection)

    Return the name of the group of atoms with index i. The atom_group_names function returns a vector with the names of all the groups.

    Example

    julia> using ComplexMixtures
     
     julia> atsel = AtomSelection([1,2,3], natomspermol=1, group_atom_indices=[[1,2],[3]], group_names=["G1", "G2"])
    @@ -203,7 +203,7 @@
     julia> atom_group_names(atsel)
     2-element Vector{String}:
      "G1"
    - "G2"
    source
    ComplexMixtures.atom_group_namesMethod
    atom_group_name(atsel::AtomSelection, i::Int)
     atom_group_names(atsel::AtomSelection)

    Return the name of the group of atoms with index i. The atom_group_names function returns a vector with the names of all the groups.

    Example

    julia> using ComplexMixtures
     
     julia> atsel = AtomSelection([1,2,3], natomspermol=1, group_atom_indices=[[1,2],[3]], group_names=["G1", "G2"])
    @@ -218,4 +218,4 @@
     julia> atom_group_names(atsel)
     2-element Vector{String}:
      "G1"
    - "G2"
    source
    + "G2"source diff --git a/dev/tools/index.html b/dev/tools/index.html index 4ccb6189..a3b070b7 100644 --- a/dev/tools/index.html +++ b/dev/tools/index.html @@ -40,7 +40,7 @@ # Compute the coordination number residue50_coordination = coordination_number(solute, R.solute_atom, R, group) # Output the average number of TMAO molecules within 5 Angstroms of residue 50 -residue50_coordination[findlast(<(5), R.d)]source

    Computing a 2D density map around a macromolecule

    One nice way to visualize the accumulation or depletion of a solvent around a macromolecule (a protein, for example), is to obtain a 2D map of the density as a function of the distance from its surface. For example, in the figure below the density of a solute (here, Glycerol), in the neighborhood of a protein is shown:

    +residue50_coordination[findlast(<(5), R.d)]source

    Computing a 2D density map around a macromolecule

    One nice way to visualize the accumulation or depletion of a solvent around a macromolecule (a protein, for example), is to obtain a 2D map of the density as a function of the distance from its surface. For example, in the figure below the density of a solute (here, Glycerol), in the neighborhood of a protein is shown:

    Here, one can see that Glycerol accumulates on Asp76 and on the proximity of hydrogen-bonding residues (Serine residues mostly). This figure was obtained by extracting from atomic contributions of the protein the contribution of each residue to the MDDF. Using PDBTools, this can be done with, for example:

    residues = collect(eachresidue(protein))
     residue_contributions = zeros(length(R.d),length(residues))
    @@ -58,9 +58,9 @@
     
     julia> R = ComplexMixtures.load("./results.json");
     
    -julia> grid = grid3D(R, atoms, "grid.pdb");

    grid will contain a vector of Atoms with the information of the MDDF at each grid point, and the same data will be written in the grid.pdb file. This PDB file can be opened in VMD, for example, and contain in the beta field the contribution of each protein residue to the MDDF at each point in space relative to the protein, and in the occupancy field the distance to the protein. Examples of how this information can be visualized are provided in the user guide of ComplexMixtures.

    source

    Computing radial distribution functions

    The distributions returned by the mddf function (the mddf and rdf vectors), are normalized by the random reference state or using a site count based on the numerical integration of the volume corresponding to each minimum-distance to the solute.

    If, however, the solute is defined by a single atom (as the oxygen atom of water, for example), the numerical integration of the volume can be replaced by a simple analytical spherical shell volume, reducing noise. The ComplexMixtures.gr function returns the radial distribution function and the KB integral computed from the results, using this volume estimate:

    g, kb = ComplexMixtures.gr(R)

    By default, the single-reference count (rdf_count) of the Result structure will be used to compute the radial distribution function. The function can be called with explicit control of all input parameters:

    g, kb = ComplexMixtures.gr(r,count,density,binstep)

    where:

    ParameterDefinitionResult structure output data to provide
    rVector of distancesThe d vector
    countNumber of site counts at each rThe rdf or mddf vectors
    densityBulk densityThe density.solvent_bulk or density.solvent densities.
    binstepThe histogram stepThe options.binstep

    Example:

    ...
    +julia> grid = grid3D(R, atoms, "grid.pdb");

    grid will contain a vector of Atoms with the information of the MDDF at each grid point, and the same data will be written in the grid.pdb file. This PDB file can be opened in VMD, for example, and contain in the beta field the contribution of each protein residue to the MDDF at each point in space relative to the protein, and in the occupancy field the distance to the protein. Examples of how this information can be visualized are provided in the user guide of ComplexMixtures.

    source

    Computing radial distribution functions

    The distributions returned by the mddf function (the mddf and rdf vectors), are normalized by the random reference state or using a site count based on the numerical integration of the volume corresponding to each minimum-distance to the solute.

    If, however, the solute is defined by a single atom (as the oxygen atom of water, for example), the numerical integration of the volume can be replaced by a simple analytical spherical shell volume, reducing noise. The ComplexMixtures.gr function returns the radial distribution function and the KB integral computed from the results, using this volume estimate:

    g, kb = ComplexMixtures.gr(R)

    By default, the single-reference count (rdf_count) of the Result structure will be used to compute the radial distribution function. The function can be called with explicit control of all input parameters:

    g, kb = ComplexMixtures.gr(r,count,density,binstep)

    where:

    ParameterDefinitionResult structure output data to provide
    rVector of distancesThe d vector
    countNumber of site counts at each rThe rdf or mddf vectors
    densityBulk densityThe density.solvent_bulk or density.solvent densities.
    binstepThe histogram stepThe options.binstep

    Example:

    ...
     R = mddf(trajectory,options)
    -g, kb = ComplexMixtures.gr(R.d,R.rdf_count,R.density.solvent_bulk,R.options.binstep)
    ComplexMixtures.grMethod
    gr(R::Result) = gr(R.d,R.rdf_count,R.density.solvent_bulk,R.files[1].options.binstep)

    If a Result structure is provided without further details, use the rdf count and the bulk solvent density.

    source
    ComplexMixtures.grMethod
    gr(r::Vector{Float64}, count::Vector{Float64}, density::Float64, binstep::Float64)

    Computes the radial distribution function from the count data and the density.

    This is exactly a conventional g(r) if a single atom was chosen as the solute and solvent selections.

    Returns both the g(r) and the kb(r)

    source

    Overview of the solvent and solute properties

    The output to the REPL of the Result structure provides an overview of the properties of the solution. The data can be retrieved into a data structure using the overview function. Examples:

    ...
    +g, kb = ComplexMixtures.gr(R.d,R.rdf_count,R.density.solvent_bulk,R.options.binstep)
    ComplexMixtures.grMethod
    gr(R::Result) = gr(R.d,R.rdf_count,R.density.solvent_bulk,R.files[1].options.binstep)

    If a Result structure is provided without further details, use the rdf count and the bulk solvent density.

    source
    ComplexMixtures.grMethod
    gr(r::Vector{Float64}, count::Vector{Float64}, density::Float64, binstep::Float64)

    Computes the radial distribution function from the count data and the density.

    This is exactly a conventional g(r) if a single atom was chosen as the solute and solvent selections.

    Returns both the g(r) and the kb(r)

    source

    Overview of the solvent and solute properties

    The output to the REPL of the Result structure provides an overview of the properties of the solution. The data can be retrieved into a data structure using the overview function. Examples:

    ...
     julia> results = mddf(trajectory)
     
     julia> results
    @@ -98,4 +98,4 @@
     -------------------------------------------------------------------------------

    In this case, since solute and solvent are equivalent and the system is homogeneous, the molar volumes and concentrations are similar. This is not the case if the molecules are different or if the solute is at infinite dilution (in which case the bulk solvent density might be different from the solvent density in the simulation).

    To retrieve the data of the overview structure use, for example:

    julia> overview = overview(results);
     
     julia> overview.solute_molar_volume
    -657.5051512801567
    +657.5051512801567 diff --git a/dev/trajectory/index.html b/dev/trajectory/index.html index bc626539..b294a580 100644 --- a/dev/trajectory/index.html +++ b/dev/trajectory/index.html @@ -1,2 +1,2 @@ -Loading the trajectory · ComplexMixtures.jl

    Loading trajectories

    To initialize a trajectory file for computation, use the command

    trajectory = Trajectory("trajectory.xtc",solute,solvent)

    where solute and solvent are defined with the AtomSelection function described before. This function opens the stream for reading frames, which are read once a time when the coordinates are required for computing the MDDF.

    The Trajectory function uses Chemfiles in background, and thus the most common trajectory formats are supported, as the ones produced with NAMD, Gromacs, LAMMPS, Amber, etc.

    Tip

    The format of the trajectory file is automatically determined by Chemfiles from the extension of the file. However, it can be provided by the user with the format keyword, for example:

    trajectory = Trajectory("trajectory.xtc",solute,solvent,format="xtc")

    Reference functions

    ComplexMixtures.TrajectoryType
    Trajectory(filename::String, solute::AtomSelection, solvent::AtomSelection; format::String = "", chemfiles = false)

    Trajectory constructor data type.

    Defaults to reading with the Chemfiles infrastructure, except for DCD and PDB trajectory files, if the "PDBTraj" option is provided.

    See memory issue (https://github.com/chemfiles/Chemfiles.jl/issues/44)

    source
    +Loading the trajectory · ComplexMixtures.jl

    Loading trajectories

    To initialize a trajectory file for computation, use the command

    trajectory = Trajectory("trajectory.xtc",solute,solvent)

    where solute and solvent are defined with the AtomSelection function described before. This function opens the stream for reading frames, which are read once a time when the coordinates are required for computing the MDDF.

    The Trajectory function uses Chemfiles in background, and thus the most common trajectory formats are supported, as the ones produced with NAMD, Gromacs, LAMMPS, Amber, etc.

    Tip

    The format of the trajectory file is automatically determined by Chemfiles from the extension of the file. However, it can be provided by the user with the format keyword, for example:

    trajectory = Trajectory("trajectory.xtc",solute,solvent,format="xtc")

    Reference functions

    ComplexMixtures.TrajectoryType
    Trajectory(filename::String, solute::AtomSelection, solvent::AtomSelection; format::String = "", chemfiles = false)

    Trajectory constructor data type.

    Defaults to reading with the Chemfiles infrastructure, except for DCD and PDB trajectory files, if the "PDBTraj" option is provided.

    See memory issue (https://github.com/chemfiles/Chemfiles.jl/issues/44)

    source
    diff --git a/dev/updating_scripts/index.html b/dev/updating_scripts/index.html index 0c3dc52a..1652472c 100644 --- a/dev/updating_scripts/index.html +++ b/dev/updating_scripts/index.html @@ -1,3 +1,3 @@ Updating scripts · ComplexMixtures.jl

    Updating scripts from v1 to v2

    The syntax chances necessary to update script from version 1.X to 2.X of the package are:

    Atom selections

    The previous Selection structure was renamed to AtomSelection for clarity.

    • Before:
    water = Selection(water; natomspermol=3)
    • Now:
    water = AtomSelection(water; natomspermol=3)

    Group contributions syntax

    The syntax to computing group contributions is improved. Previously, the contrib or contributions functions required three somewhat redundant parameters.

    • Before:

    The call to contributions required 3 parameters: the Selection structure, the matrix of contributions, and the indexes of the atoms for which the contributions were desired:

    h_contributions = contributions(solvent, R.solvent_atom, h_indexes)
    • Now:

    The contributions are extracted from the Result data structure, by providing either a SoluteGroup or SolventGroup object, which are setup with the group names, group indexes, atom names, or atom indexes:

    h_contributions = contributions(R, SolventGroup(h_indexes))

    Frame weights

    frame_weights is now an option of the mddf execution. That is previously, they were defined in the Options data structure, and now they are passed to the mddf function.

    • Before:
    options = Options(frame_weights=[1.0, 2.0])
    -results = mddf(trajectory, options)
    • Now:
    results = mddf(trajectory, options; frame_weights=[1.0, 2.0])
    +results = mddf(trajectory, options)
    results = mddf(trajectory, options; frame_weights=[1.0, 2.0])