Help entries

ComplexMixtures.BoxType
struct Box{FloatVector, IntVector}

Structure that contains some data required to compute the linked cells.

  • sides::Any

  • nc::Any

  • l::Any

  • lcell::Int64

source
ComplexMixtures.ChemFileType
struct ChemFile{T<:(AbstractVector{T} where T)} <: Trajectory

Structure to contain a trajectory as read by Chemfiles.jl

  • filename::String

  • format::AbstractString

  • stream::Vector{Chemfiles.Trajectory}

  • nframes::Int64

  • sides::Vector{T} where T<:(AbstractVector{T} where T)

  • solute::Selection

  • solvent::Selection

  • x_solute::Vector{T} where T<:(AbstractVector{T} where T)

  • x_solvent::Vector{T} where T<:(AbstractVector{T} where T)

  • natoms::Int64

source
ComplexMixtures.ChemFileMethod
ChemFile(filename::String, solute::Selection, solvent::Selection;format="" , T::Type = SVector{3,Float64})

Function open will set up the IO stream of the trajectory, fill up the number of frames field and additional parameters if required

The IO stream must be returned in a position such that the "nextframe!" function will be able to read the first frame of the trajectory

source
ComplexMixtures.CutoffDistancesType
struct CutoffDistances

Structure to contain a list of all the distances smaller than the cutoff.

  • nd::Vector{Int64}

  • d::Vector{Float64}

  • iat::Vector{Int64}

  • jat::Vector{Int64}

  • imol::Vector{Int64}

  • jmol::Vector{Int64}

  • maxdim::Vector{Int64}

source
ComplexMixtures.DensityType
mutable struct Density

Structure to contain the density values obtained from the calculation.

  • solute::Float64

    Default: 0.0

  • solvent::Float64

    Default: 0.0

  • solvent_bulk::Float64

    Default: 0.0

source
ComplexMixtures.DminMolType
mutable struct DminMol

Auxiliary structure used to update counters.

  • d::Float64

  • jmol::Int64

  • iat::Int64

  • jat::Int64

source
ComplexMixtures.FrameDataType
mutable struct FrameData{T<:Trajectory, V}

Structure to contain data needed to compute the mddf for a single frame

  • trajectory::Trajectory

  • volume_frame::ComplexMixtures.Volume

  • rdf_count_random_frame::Vector{Float64}

  • md_count_random_frame::Vector{Float64}

  • dc::ComplexMixtures.CutoffDistances

  • dmin_mol::Vector{ComplexMixtures.DminMol}

  • dref_mol::Vector{Float64}

  • x_solvent_random::Vector{V} where V

  • lc_solvent::ComplexMixtures.LinkedCells

source
ComplexMixtures.LinkedCellsType
LinkedCells

firstatom is a vector that contains for each index i3D = index3D(i,j,k) of a box, which is the first atom of the list of atoms in that box.

nextatom is a vector that contains the index of the next atom of that box given the index of the previous atom (starting with firstatom).

source
ComplexMixtures.NamdDCDType
struct NamdDCD{T<:(AbstractVector{T} where T)} <: Trajectory

Structure to contain the data of a trajectory in NAMD/DCD format.

  • filename::String

  • stream::FortranFiles.FortranFile

  • nframes::Int64

  • sides::Vector{T} where T<:(AbstractVector{T} where T)

  • solute::Selection

  • solvent::Selection

  • x_solute::Vector{T} where T<:(AbstractVector{T} where T)

  • x_solvent::Vector{T} where T<:(AbstractVector{T} where T)

  • sides_in_dcd::Bool

  • lastatom::Int64

  • sides_read::Vector{Float64}

  • x_read::Vector{Float32}

  • y_read::Vector{Float32}

  • z_read::Vector{Float32}

source
ComplexMixtures.NamdDCDMethod
NamdDCD(filename::String, solute::Selection, solvent::Selection;T::Type = SVector{3,Float64})

This function initializes the structure above, returning the data and the vectors with appropriate lengths and, importantly, with the i/o stream OPENED, ready to read the first trajectory frame using the "nextframe" function.

source
ComplexMixtures.OptionsType
struct Options

Structure that contains the detailed input options.

  • firstframe::Int64

    Default: 1

  • lastframe::Int64

    Default: -1

  • stride::Int64

    Default: 1

  • periodic::Bool

    Default: true

  • irefatom::Int64

    Default: -1

  • n_random_samples::Int64

    Default: 10

  • binstep::Float64

    Default: 0.02

  • dbulk::Float64

    Default: 10.0

  • cutoff::Float64

    Default: 10.0

  • usecutoff::Bool

    Default: false

  • lcell::Int64

    Default: 2

  • sleep::Float64

    Default: 0.01

  • GC::Bool

    Default: true

  • GC_threshold::Float64

    Default: 0.1

  • seed::Int64

    Default: 321

  • StableRNG::Bool

    Default: false

  • nthreads::Int64

    Default: -1

  • silent::Bool

    Default: false

source
ComplexMixtures.OutputFilesType
mutable struct OutputFiles

Structure to contain the names of the output files.

  • output::String

  • solute_atoms::String

  • solvent_atoms::String

source
ComplexMixtures.OverviewType
mutable struct Overview

Structure that is used to dispatch the show of a overview.

  • R::Result

  • domain_molar_volume::Float64

    Default: 0.0

  • density::ComplexMixtures.Density

    Default: Density()

  • solvent_molar_volume::Float64

    Default: 0.0

  • solvent_molar_volume_bulk::Float64

    Default: 0.0

  • solute_molar_volume::Float64

    Default: 0.0

source
ComplexMixtures.PDBTrajType
struct PDBTraj{T<:(AbstractVector{T} where T)} <: Trajectory

Structure to contain PDB trajectories. Frames must be separated by "END", and with periodic cell sizes in the "CRYST1" field.

This structure and functions can be used as a template to implement the reading of other trajectory formats.

  • filename::String

  • stream::IOStream

  • nframes::Int64

  • sides::Vector{T} where T<:(AbstractVector{T} where T)

  • solute::Selection

  • solvent::Selection

  • x_solute::Vector{T} where T<:(AbstractVector{T} where T)

  • x_solvent::Vector{T} where T<:(AbstractVector{T} where T)

  • natoms::Int64

  • x_read::Matrix{Float64}

source
ComplexMixtures.PDBTrajMethod
PDBTraj(pdbfile::String, solute::Selection, solvent::Selection;T::Type = SVector{3,Float64})

Function open will set up the IO stream of the trajectory, fill up the number of frames field and additional parameters if required

The IO stream must be returned in a position such that the "nextframe!" function will be able to read the first frame of the trajectory

source
ComplexMixtures.ResultType
struct Result

Structure to contain the results of the MDDF calculation.

  • nbins::Int64

  • dbulk::Float64

  • cutoff::Float64

  • d::Vector{Float64}

    Default: zeros(nbins)

  • md_count::Vector{Float64}

    Default: zeros(nbins)

  • md_count_random::Vector{Float64}

    Default: zeros(nbins)

  • sum_md_count::Vector{Float64}

    Default: zeros(nbins)

  • sum_md_count_random::Vector{Float64}

    Default: zeros(nbins)

  • mddf::Vector{Float64}

    Default: zeros(nbins)

  • kb::Vector{Float64}

    Default: zeros(nbins)

  • autocorrelation::Bool

  • solvent::ComplexMixtures.SolSummary

  • solute::ComplexMixtures.SolSummary

  • solute_atom::Matrix{Float64}

    Default: zeros(nbins, solute.natomspermol)

  • solvent_atom::Matrix{Float64}

    Default: zeros(nbins, solvent.natomspermol)

  • rdf_count::Vector{Float64}

    Default: zeros(nbins)

  • rdf_count_random::Vector{Float64}

    Default: zeros(nbins)

  • sum_rdf_count::Vector{Float64}

    Default: zeros(nbins)

  • sum_rdf_count_random::Vector{Float64}

    Default: zeros(nbins)

  • rdf::Vector{Float64}

    Default: zeros(nbins)

  • kb_rdf::Vector{Float64}

    Default: zeros(nbins)

  • density::ComplexMixtures.Density

    Default: Density()

  • volume::ComplexMixtures.Volume

    Default: Volume(nbins)

  • options::Options

  • irefatom::Int64

  • lastframe_read::Int64

  • nframes_read::Int64

  • files::Vector{String}

  • weights::Vector{Float64}

source
ComplexMixtures.SamplesType
struct Samples

Simple structure to contain the number of samples of each type of calculation to compute final results

  • md::Float64

  • random::Int64

source
ComplexMixtures.SelectionType
struct Selection

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

  • natoms::Int64

  • nmols::Int64

  • natomspermol::Int64

  • index::Vector{Int64}

  • imol::Vector{Int64}

  • names::Vector{String}

source
ComplexMixtures.SolSummaryType
struct SolSummary

Structures to contain the details of a solute or solvent to store in the results of the MDDF calculation.

  • natoms::Int64

  • nmols::Int64

  • natomspermol::Int64

source
ComplexMixtures.TrajectoryType
Trajectory

Trajectory data type. Default 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
ComplexMixtures.UnitsType
struct Units

Unit conversions.

  • mole::Any

    Default: 6.022140857e23

  • Angs3tocm3::Any

    Default: 1.0e24

  • Angs3toL::Any

    Default: 1.0e27

  • Angs3tocm3permol::Any

    Default: mole / Angs3tocm3

  • Angs3toLpermol::Any

    Default: mole / Angs3toL

  • SitesperAngs3tomolperL::Any

    Default: Angs3toL / mole

source
ComplexMixtures.VolumeType
mutable struct Volume

Structures to contain the volumes obtained from calculations.

  • total::Float64

  • bulk::Float64

  • domain::Float64

  • shell::Vector{Float64}

source
Base.isapproxMethod
Base.isapprox(r1::T, r2::T; debug=false) where T <: CMTypes

Function to test if two runs offered similar results. Mostly used in the package testing routines

source
Base.mergeMethod
merge(r::Vector{ComplexMixutures.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
Base.writeMethod
write(R::ComplexMixtures.Result, filename::String, solute::Selection, solvent::Selection)

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 selections are provides, pass on the atom names.

source
Base.writeMethod
write(R::ComplexMixtures.Result, filename::String; 
      solute_names::Vector{String} = ["nothing"], 
      solvent_names::Vector{String} = ["nothing"])

Optional passing of atom names.

source
ComplexMixtures.VMDselectMethod
VMDselect(inputfile::String, selection::String; vmd="vmd" )

Select atoms using vmd selection syntax, with vmd in background

Returns the list of index (one-based) and atom names

Function to return the selection from a input file (topology, coordinates, etc), by calling VMD in the background.

source
ComplexMixtures.center_to_origin!Method
center_to_origin!(x::Vector{T}, center::T) where T

Translates atoms of vectory in x array such that center is in the origin. (x is a vector of vectors).

source
ComplexMixtures.contribMethod
contrib(s::Selection, atom_contributions::Array{Float64}, selection)

Extract the contribution of a given atom type selection from the solute or solvent atomic contributions to the MDDF.

s here is the solute or solvent selection (type ComplexMixtures.Selection) atom_contributions is the R.solute_atom or R.solvent_atom arrays of the Result structure, and the last argument is the selection of atoms from the solute to be considered, given as a list of indexes, list of atom names, vector of PDBTools.Atoms, or a PDBTools.Residue.

source
ComplexMixtures.cutoffdcell!Method
cutoffdcell!(cutoff::Float64, 
             iat::Int, xat::T,
             x_solvent::Vector{T},
             lc_solvent::LinkedCells,
             box::Box,
             i::Int, j::Int, k::Int,
             dc::CutoffDistances) where T

Function that computes all distance of a point "xat" to the atoms of the solvent found in the linked cell corresponding to indexes i, j, and k

Modifies the data of dc

source
ComplexMixtures.cutoffdcell_self!Method
cutoffdcell_self!(cutoff::Float64, 
                  iat::Int, xat::T,
                  x_solvent::Vector{T},
                  lc_solvent::LinkedCells,
                  box::Box,
                  i::Int, j::Int, k::Int,
                  dc::CutoffDistances,
                  solvent::Selection,
                  imol::Int) where T

Function that computes all distance of a point xat to the atoms of the solvent found in the linked cell corresponding to indexes i, j, and k.

Modifies the data of dc

source
ComplexMixtures.cutoffdistances!Method
cutoffdistances!(cutoff::Float64,
                 x_solute::AbstractVector{T},
                 x_solvent::Vector{T},
                 lc_solvent::LinkedCells,
                 box::Box, 
                 dc::CutoffDistances) where T

This routine that returns a list of the distances between atoms that are smaller than a specified cutoff, for a given set of coordinates.

Returns nd, the number of distances smaller than the cutoff, and modifies dc.

source
ComplexMixtures.cutoffdistances_self!Method
cutoffdistances_self!(cutoff::Float64,
                      x_solute::AbstractVector{T},
                      x_solvent::Vector{T},
                      lc_solvent::LinkedCells,
                      box::Box, 
                      dc::CutoffDistances, 
                      solvent::Selection, imol::Int) where T

This routine that returns a list of the distances between atoms that are smaller than a specified cutoff, for a given set of coordinates.

Returns nd, the number of distances smaller than the cutoff, and modifies dc.

source
ComplexMixtures.distanceMethod
distance(x,y,sides)

Functions to compute Euclidean distances between two 3-dimensional vectors, with periodic boundary conditions given by sides.

source
ComplexMixtures.eulermatMethod
eulermat(beta, gamma, theta, deg::String)

This routine was added because it defines the rotation in the "human" way, an is thus used to set the position of the fixed molecules. deg can only be "degree", in which case the angles with be considered in degrees. If no deg argument is provided, radians are used.

That means: beta is a counterclockwise rotation around x axis. gamma is a counterclockwise rotation around y axis. theta is a counterclockwise rotation around z axis.

source
ComplexMixtures.finalresults!Method
finalresults!(R::Result, options::Options, trajectory::Trajectory, samples::Samples)

Function that computes the final results of all the data computed by averaging according to the sampling of each type of data, and converts to common units.

Computes also the final distribution functions and KB integrals

This function modified the values contained in the R data structure

source
ComplexMixtures.grMethod
gr(R::Result) = gr(R.d,R.rdf_count,R.density.solvent_bulk,R.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
ComplexMixtures.grid3DMethod
grid3D(solute,solute_atoms,mddf_result,output_file; dmin=1.5, ddax=5.0, step=0.5)

This function builds the grid of the 3D density function and fills an array of mutable structures of type Atom, containing the position of the atoms of grid, the closest atom to that position, and distance.

solute is a ComplexMixtuers.Selection, defining the solute. solute_atoms is the corresponding vector of PDBTools.Atoms, and mddf_result is the result of a mddf_result calculation with the correspondign solute.

dmin and dmax define the range of distance where the density grid will be built, and step defines how fine the grid must be. Be aware that fine grids involve usually a very large (hundreds of thousands points).

All parameters can be provides as keyword parameters.

Example

julia> using ComplexMixtures, PDBTools

julia> pdb = readPDB("./system.pdb");

julia> R = ComplexMixtures.load("./results.json");

julia> protein = select(pdb,"protein");

julia> solute = ComplexMixtures.Selection(protein,nmols=1);

julia> grid = ComplexMixtures.grid3D(solute=solute, solute_atoms=protein, mddf_result=R, output_file="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
ComplexMixtures.icell1DMethod
icell1D(nc::AbstractVector, i, j, k)

Returns the index of the linked cell, in the 1D representation, from its i,j,k coordinates.

source
ComplexMixtures.inbulkMethod
inbulk(d, R::Result)

Function that returns if a distance is in the bulk region or not, according to the options

source
ComplexMixtures.initcells!Method
initcells!(x::AbstractVector{T}, box::Box, lc::LinkedCells) where T

Function that initializes the linked cells by computing to each cell each atom belongs and filling up the firstatom and nexatom arrays.

Modifies the data in the lc structure

source
ComplexMixtures.itypeMethod

Given the index of the atom in the vector of coordinates of the solute or the solvent, returns the type of the atom, that is, the index of this atom within the molecule (goes from 1 to natomspermol)

source
ComplexMixtures.loadMethod
load(filename::String)

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

source
ComplexMixtures.mddfMethod
mddf(trajectory::Trajectory, options::Options)

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 = ComplexMixtures.Trajectory("./trajectory.dcd",solute,solvent);

julia> results = ComplexMixtures.mddf(trajectory);

or

julia> options = Options(lastframe=1000);

julia> results = ComplexMixtures.mddf(trajectory,options);
source
ComplexMixtures.mddf_frame!Method
mddf_frame!(iframe::Int, framedata::FrameData, options::Options, RNG, R::Result)

Computes the MDDF for a single frame, modifies the data in the R (type Result) structure.

source
ComplexMixtures.mddf_frame_self!Method
mddf_frame_self!(iframe::Int, framedata::FrameData, options::Options, RNG, R::Result)

Computes the MDDF for a single frame, modifies the data in the R (Result) structure.

source
ComplexMixtures.mddf_linkedcellsMethod
mddf_linkedcells(trajectory::Trajectory, options::Options,samples::Samples, RNG, mddf_compute!)  

Computes the MDDF using linked cells, serial version.

source
ComplexMixtures.move!Method
move!(x::AbstractVector{T}, newcm::AbstractVector,beta, gamma, theta) where T

Translates and rotates a molecule according to the desired input center of coordinates and Euler rotations modifyies the vector x.

source
ComplexMixtures.random_move!Method
random_move!(x_ref::AbstractVector{T}, 
             irefatom::Int,
             sides::T,
             x_new::AbstractVector{T}, RNG) where T

Function that generates a new random position for a molecule.

The new position is returned in x, a previously allocated array.

x_solvent_random might be a view of the array that contains all the solvent molecules.

source
ComplexMixtures.setbinMethod
setbin(d,step)

Function that sets to which histogram bin a data point pertains simple, but important to keep consistency over all calls.

source
ComplexMixtures.sum!Method
sum!(R1::Result, R2::Result)

Sum the counts of two Results structures, adding the result to the first structure as in R1 = R1 + R2.

source
ComplexMixtures.updatecounters!Method

Function that updates the counters in R and returns n_dmin_in_bulk given the output of cutoffdistances.

If the solute and solvent selections are provided, update mdcount, rdfcount and the atom-specific counters

returns: n_dmin_in_bulk: number of molecules with all the atoms in the bulk n_dref_in_bulk: number of molecules with the reference atom in the bulk

source
ComplexMixtures.viewmolMethod
viewmol(i::Int, x::Vector{T}, n::Int) where T

Returns a view of a coordinate vector corresponding to the atoms of a molecule with index i. n is the number of atoms of the molecule.

source
ComplexMixtures.which_typesMethod
which_types(s::Selection, indexes::Vector{Int})

Function that returns the list of the indexes of the types of the atoms in a selection. For example, if a selection corresponds to a solvent of water molecules: There are three types, 1, 2, and 3, corresponding to the three atoms of the water molecule. If the indexes provided are, for instance, 11, 12, and 13, corresponding to a water molecule, this function will return 1, 2 and 3.

This is used to get equivalent-atom contributions to the distribution functions. For example, the input indexes span all water molecules, the output of this function will be still the three indexes corresponding to the three types of atoms that exist in a water molecule.

It is not possible to compute the contribution of one individual water molecule if the distribution function was computed for all molecules. Thus, the necessity to identify the types of atoms involved in a selection.

source
ComplexMixtures.wrap!Method

Functions that wrap the coordinates

They modify the coordinates of the input vector.

function wrap!(x::AbstractVector{T}, sides::T, center::T) where T <: AbstractVector

Wrap to a given center of coordinates

source
ComplexMixtures.wrap_cellMethod
wrap_cell(nc::AbstractVector, i::Int, j::Int, k::Int)

Given the indexes of a cell, return the periodic cell which correspondst to it, if the cell is outside the main box.

source

``