diff --git a/dev/contrib/index.html b/dev/contrib/index.html index 44c338b9..9a90633f 100644 --- a/dev/contrib/index.html +++ b/dev/contrib/index.html @@ -47,4 +47,4 @@ neutral_contributions = contributions(solute,R.solute_atom,neutral_residues)

The charged and neutral outputs are vectors containing the contributions of these residues to the total MDDF. The corresponding plot is:

plot(results.d,results.mddf,label="Total MDDF",linewidth=2)
 plot!(results.d,charged_contributions,label="Charged residues",linewidth=2)
 plot!(results.d,neutral_contributions,label="Neutral residues",linewidth=2)
-plot!(xlabel="Distance / Å",ylabel="MDDF")

Resulting in:

Note here how charged residues contribute strongly to the peak at hydrogen-bonding distances, but much less in general. Of course all selection options could be used, to obtain the contributions of specific types of residues, atoms, the backbone, the side-chains, etc.

+plot!(xlabel="Distance / Å",ylabel="MDDF")

Resulting in:

Note here how charged residues contribute strongly to the peak at hydrogen-bonding distances, but much less in general. Of course all selection options could be used, to obtain the contributions of specific types of residues, atoms, the backbone, the side-chains, etc.

diff --git a/dev/examples/index.html b/dev/examples/index.html index 050b36ad..221bbb37 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -68,4 +68,4 @@ output_file="grid.pdb", dmin=1.5, dmax=3.5 -)

The command above will generate the grid, save it to grid.pdb and let it available in the grid.pdb array of atoms, for further inspection, if desired.

By changing dmin, dmax, and step, one controls the grid size and resolution. This may generate very large output files.

+)

The command above will generate the grid, save it to grid.pdb and let it available in the grid.pdb array of atoms, for further inspection, if desired.

By changing dmin, dmax, and step, one controls the grid size and resolution. This may generate very large output files.

diff --git a/dev/help/index.html b/dev/help/index.html index 9070f405..8d28c337 100644 --- a/dev/help/index.html +++ b/dev/help/index.html @@ -1,7 +1,7 @@ -Help entries · ComplexMixtures.jl

Help entries

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

Structure to contain a trajectory as read by Chemfiles.jl

  • filename::String

  • format::AbstractString

  • stream::ComplexMixtures.Stream{<:Chemfiles.Trajectory}

  • nframes::Int64

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

  • solute::Selection

  • solvent::Selection

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

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

  • 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.

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.MinimumDistanceType
struct MinimumDistance

Internal structure or function, interface may change.

Extended help

This structure contains the information, for each molecule, of if it is within the cutoff distance of the solute, the atom indexes of the associated minimum distance, the distance, and a label to mark if the reference atom of the molecule is within the cutoff distance of the solute.

The lists of minimum-distances are stored in arrays of type Vector{MinimumDistance}. The index of this vector corresponds to the index of the molecule in the original array.

  • within_cutoff::Bool

  • i::Int64

  • j::Int64

  • d::Float64

  • ref_atom_within_cutoff::Bool

  • d_ref_atom::Float64

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

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

  • filename::String

  • stream::ComplexMixtures.Stream{<:FortranFiles.FortranFile}

  • nframes::Int64

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

  • solute::Selection

  • solvent::Selection

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

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

  • 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.

source
ComplexMixtures.OptionsType
struct Options

Structure that contains the detailed input options.

  • firstframe::Int64: Default: 1

  • lastframe::Int64: Default: -1

  • stride::Int64: Default: 1

  • 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: 1

  • GC::Bool: Default: true

  • GC_threshold::Float64: Default: 0.1

  • seed::Int64: Default: 321

  • StableRNG::Bool: Default: false

  • nthreads::Int64: Default: 0

  • silent::Bool: Default: false

source
ComplexMixtures.OutputFilesType

Internal structure or function, interface may change.

mutable struct OutputFiles

Structure to contain the names of the output files.

  • output::String

  • solute_atoms::String

  • solvent_atoms::String

source
ComplexMixtures.OverviewType

Internal structure or function, interface may change.

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)} <: 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::ComplexMixtures.Stream{<:IOStream}

  • nframes::Int64

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

  • solute::Selection

  • solvent::Selection

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

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

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

source
ComplexMixtures.ResultType
mutable struct Result{T<:VecOrMat{Float64}}

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)

  • coordination_number::Vector{Float64}: Default: zeros(nbins)

  • coordination_number_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::VecOrMat{Float64}: Default: zeros(nbins, solute.natomspermol)

  • solvent_atom::VecOrMat{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}

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

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

Internal structure or function, interface may change.

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(filename::String, solute::Selection, solvent::Selection; 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
ComplexMixtures.UnitsType

Internal structure or function, interface may change.

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

Internal structure or function, interface may change.

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

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
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; 
+Help entries · ComplexMixtures.jl

Help entries

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

Structure to contain a trajectory as read by Chemfiles.jl

  • filename::String

  • format::AbstractString

  • stream::ComplexMixtures.Stream{<:Chemfiles.Trajectory}

  • nframes::Int64

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

  • solute::Selection

  • solvent::Selection

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

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

  • 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.

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.MinimumDistanceType
struct MinimumDistance

Internal structure or function, interface may change.

Extended help

This structure contains the information, for each molecule, of if it is within the cutoff distance of the solute, the atom indexes of the associated minimum distance, the distance, and a label to mark if the reference atom of the molecule is within the cutoff distance of the solute.

The lists of minimum-distances are stored in arrays of type Vector{MinimumDistance}. The index of this vector corresponds to the index of the molecule in the original array.

  • within_cutoff::Bool

  • i::Int64

  • j::Int64

  • d::Float64

  • ref_atom_within_cutoff::Bool

  • d_ref_atom::Float64

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

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

  • filename::String

  • stream::ComplexMixtures.Stream{<:FortranFiles.FortranFile}

  • nframes::Int64

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

  • solute::Selection

  • solvent::Selection

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

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

  • 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.

source
ComplexMixtures.OptionsType
struct Options

Structure that contains the detailed input options.

  • firstframe::Int64: Default: 1

  • lastframe::Int64: Default: -1

  • stride::Int64: Default: 1

  • 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: 1

  • GC::Bool: Default: true

  • GC_threshold::Float64: Default: 0.1

  • seed::Int64: Default: 321

  • StableRNG::Bool: Default: false

  • nthreads::Int64: Default: 0

  • silent::Bool: Default: false

source
ComplexMixtures.OutputFilesType

Internal structure or function, interface may change.

mutable struct OutputFiles

Structure to contain the names of the output files.

  • output::String

  • solute_atoms::String

  • solvent_atoms::String

source
ComplexMixtures.OverviewType

Internal structure or function, interface may change.

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)} <: 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::ComplexMixtures.Stream{<:IOStream}

  • nframes::Int64

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

  • solute::Selection

  • solvent::Selection

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

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

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

source
ComplexMixtures.ResultType
mutable struct Result{T<:VecOrMat{Float64}}

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)

  • coordination_number::Vector{Float64}: Default: zeros(nbins)

  • coordination_number_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::VecOrMat{Float64}: Default: zeros(nbins, solute.natomspermol)

  • solvent_atom::VecOrMat{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}

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

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

Internal structure or function, interface may change.

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(filename::String, solute::Selection, solvent::Selection; 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
ComplexMixtures.UnitsType

Internal structure or function, interface may change.

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

Internal structure or function, interface may change.

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

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
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.contributionsMethod
contributions(s::Selection, atom_contributions::Matrix{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.

Extended help

For selections of one molecule, the function has an additional keyword option first_atom_is_ref that is false by default. If set to true, the index first atom of the selection is considered as a reference atom. For example if a solute has 100 atoms, but its first atom in the PDB file is number 901, the selection of indexes [1, 2, 3] will refer to atoms with indexes [901, 902, 903].

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.contributionsMethod
contributions(s::Selection, atom_contributions::Matrix{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.

Extended help

For selections of one molecule, the function has an additional keyword option first_atom_is_ref that is false by default. If set to true, the index first atom of the selection is considered as a reference atom. For example if a solute has 100 atoms, but its first atom in the PDB file is number 901, the selection of indexes [1, 2, 3] will refer to atoms with indexes [901, 902, 903].

source
ComplexMixtures.coordination_numberMethod
coordination_number(R::Result) = R.coordination_number
 coordination_number(R::Result, group_contributions::Vector{Float64})
 coordination_number(s::Selection, atom_contributions::Matrix{Float64}, R::Result, group)

Computes the coordination number of a given group of atoms from the solute or solvent atomic contributions to the MDDF. If no group is defined (first call above), the coordination number of the whole solute or solvent is returned.

If the group_contributions to the mddf are computed previously with the contributions function, the result can be used to compute the coordination number by calling coordination_number(R::Result, group_contributions).

Otherwise, the coordination number can be computed directly with the second call, where:

s 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

R is 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, or a selection following the syntax of PDBTools, or vector of PDBTools.Atoms, or a PDBTools.Residue

Examples

In the following example we compute the coordination number of the atoms of residue 50 (of the solute) with the solvent atoms of TMAO, as a function of the distance. Finally, we show the average number of TMAO molecules within 5 Angstroms of residue 50. The findlast(<(5), R.d) part of the code below returns the index of the last element of the R.d array that is smaller than 5 Angstroms.

Precomputing the group contributions Using the contributions function

using ComplexMixtures, PDBTools
 pdb = readPDB("test/data/NAMD/structure.pdb");
@@ -21,7 +21,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
ComplexMixtures.eulermatMethod
eulermat(beta, gamma, theta, deg::String)

Internal structure or function, interface may change.

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)

Internal structure or function, interface may change.

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
+residue50_coordination[findlast(<(5), R.d)]
source
ComplexMixtures.eulermatMethod
eulermat(beta, gamma, theta, deg::String)

Internal structure or function, interface may change.

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)

Internal structure or function, interface may change.

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");
 
@@ -32,12 +32,12 @@
 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.itypeMethod
itype(iatom::Int, natomspermol::Int)

Internal structure or function, interface may change.

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

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.itypeMethod
itype(iatom::Int, natomspermol::Int)

Internal structure or function, interface may change.

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.mddfFunction
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 = 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
ComplexMixtures.mddf_frame!Method
mddf_frame!(R::Result, system::AbstractPeriodicSystem, buff::Buffer, options::Options, RNG)

Internal structure or function, interface may change.

Computes the MDDF for a single frame, for autocorrelation of molecules. Modifies the data in the R (type Result) structure.

source
ComplexMixtures.minimum_distances!Method
minimum_distances!(system::CellListMap.PeriodicSystem, R::Result)

Internal structure or function, interface may change.

Function that computes the list of distances of solvent molecules to a solute molecule. It updates the lists of minimum distances.

source
ComplexMixtures.mol_indexMethod
mol_index(i_atom, natomspermol) = (i_atom-1) ÷ natomspermol + 1

Internal structure or function, interface may change.

Extended help

Sets the index of the molecule of an atom in the simples situation, in which all molecules have the same number of atoms.

source
ComplexMixtures.mol_rangeMethod
mol_range(imol, n_atoms_per_molecule)

Internal structure or function, interface may change.

Given the index and the number of atoms per molecule, returns the range of indices of of an array of coordinates that corresponds to the molecule.

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

Internal structure or function, interface may change.

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

source
ComplexMixtures.mddf_frame!Method
mddf_frame!(R::Result, system::AbstractPeriodicSystem, buff::Buffer, options::Options, RNG)

Internal structure or function, interface may change.

Computes the MDDF for a single frame, for autocorrelation of molecules. Modifies the data in the R (type Result) structure.

source
ComplexMixtures.minimum_distances!Method
minimum_distances!(system::CellListMap.PeriodicSystem, R::Result)

Internal structure or function, interface may change.

Function that computes the list of distances of solvent molecules to a solute molecule. It updates the lists of minimum distances.

source
ComplexMixtures.mol_indexMethod
mol_index(i_atom, natomspermol) = (i_atom-1) ÷ natomspermol + 1

Internal structure or function, interface may change.

Extended help

Sets the index of the molecule of an atom in the simples situation, in which all molecules have the same number of atoms.

source
ComplexMixtures.mol_rangeMethod
mol_range(imol, n_atoms_per_molecule)

Internal structure or function, interface may change.

Given the index and the number of atoms per molecule, returns the range of indices of of an array of coordinates that corresponds to the molecule.

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

Internal structure or function, interface may change.

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,
              system::AbstractPeriodicSystem,
-             x_new::AbstractVector{T}, RNG) where {T<:SVector}

Internal structure or function, interface may change.

Function that generates a new random position for a molecule.

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

source
ComplexMixtures.randomize_solvent!Method
randomize_solvent!(system, buff, n_solvent_in_bulk, options, RNG)

Internal structure or function, interface may change.

Generate a random solvent distribution from the bulk molecules of a solvent

source
ComplexMixtures.setbinMethod
setbin(d,step)

Internal structure or function, interface may change.

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

source
ComplexMixtures.setup_PeriodicSystemMethod
setup_PeriodicSystem(trajectory::Trajectory, options::Options)

Internal structure or function, interface may change.

Setup the periodic system from CellListMap, to compute minimimum distances. The system will be setup such that xpositions corresponds to one molecule of the solute, and ypositions contains all coordinates of all atoms of the solvent.

source
ComplexMixtures.shellradiusMethod
shellradius(i,step)

Internal structure or function, interface may change.

Compute the point in which the radius comprises half of the volume of the shell.

source
ComplexMixtures.sphericalshellvolumeMethod
sphericalshellvolume(i,step)

Internal structure or function, interface may change.

Computes the volume of the spherical shell defined within [(i-1)step,istep].

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

Internal structure or function, interface may change.

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

source
ComplexMixtures.titleMethod
title(R::Result, solute::Selection, solvent::Selection)
-title(R::Result, solute::Selection, solvent::Selection, nspawn::Int)

Internal structure or function, interface may change.

Print some information about the run.

source
ComplexMixtures.update_list!Method
update_list!(i, j, d2, iref_atom::Int, mol_index_i::F, isolute::Int, list::Vector{MinimumDistance{T}}) where {F<:Function, T}

Internal structure or function, interface may change.

Function that updates a list of minimum distances given the indexes of the atoms involved for one pair within cutoff, for autocorrelations (such that the identity of isolute is needed)

source
ComplexMixtures.update_list!Method
update_list!(i, j, d2, iref_atom::Int, mol_index_i::F, list::Vector{MinimumDistance{T}}) where {F<:Function, T}

Internal structure or function, interface may change.

Function that updates a list of minimum distances given the indexes of the atoms involved for one pair within cutoff.

source
ComplexMixtures.update_mdMethod
update_md(md1::MinimumDistance{T}, md2::MinimumDistance{T}) where {T}

Internal structure or function, interface may change.

Function that returns the updated minimum distance structure after comparing two structures associated with the same molecule.

source
ComplexMixtures.updatecounters!Method
updatecounters!(R::Result, system::AbstractPeriodicSystem)

Internal structure or function, interface may change.

Function that updates the minimum-distance counters in R

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

Internal structure or function, interface may change.

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})

Internal structure or function, interface may change.

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.writexyzMethod
writexyz(x::Vector{T}, file::String) where T <: AbstractVector

Internal structure or function, interface may change.

Print test xyz file.

source
+ x_new::AbstractVector{T}, RNG) where {T<:SVector}

Internal structure or function, interface may change.

Function that generates a new random position for a molecule.

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

source
ComplexMixtures.randomize_solvent!Method
randomize_solvent!(system, buff, n_solvent_in_bulk, options, RNG)

Internal structure or function, interface may change.

Generate a random solvent distribution from the bulk molecules of a solvent

source
ComplexMixtures.setbinMethod
setbin(d,step)

Internal structure or function, interface may change.

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

source
ComplexMixtures.setup_PeriodicSystemMethod
setup_PeriodicSystem(trajectory::Trajectory, options::Options)

Internal structure or function, interface may change.

Setup the periodic system from CellListMap, to compute minimimum distances. The system will be setup such that xpositions corresponds to one molecule of the solute, and ypositions contains all coordinates of all atoms of the solvent.

source
ComplexMixtures.shellradiusMethod
shellradius(i,step)

Internal structure or function, interface may change.

Compute the point in which the radius comprises half of the volume of the shell.

source
ComplexMixtures.sphericalshellvolumeMethod
sphericalshellvolume(i,step)

Internal structure or function, interface may change.

Computes the volume of the spherical shell defined within [(i-1)step,istep].

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

Internal structure or function, interface may change.

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

source
ComplexMixtures.titleMethod
title(R::Result, solute::Selection, solvent::Selection)
+title(R::Result, solute::Selection, solvent::Selection, nspawn::Int)

Internal structure or function, interface may change.

Print some information about the run.

source
ComplexMixtures.update_list!Method
update_list!(i, j, d2, iref_atom::Int, mol_index_i::F, isolute::Int, list::Vector{MinimumDistance{T}}) where {F<:Function, T}

Internal structure or function, interface may change.

Function that updates a list of minimum distances given the indexes of the atoms involved for one pair within cutoff, for autocorrelations (such that the identity of isolute is needed)

source
ComplexMixtures.update_list!Method
update_list!(i, j, d2, iref_atom::Int, mol_index_i::F, list::Vector{MinimumDistance{T}}) where {F<:Function, T}

Internal structure or function, interface may change.

Function that updates a list of minimum distances given the indexes of the atoms involved for one pair within cutoff.

source
ComplexMixtures.update_mdMethod
update_md(md1::MinimumDistance{T}, md2::MinimumDistance{T}) where {T}

Internal structure or function, interface may change.

Function that returns the updated minimum distance structure after comparing two structures associated with the same molecule.

source
ComplexMixtures.updatecounters!Method
updatecounters!(R::Result, system::AbstractPeriodicSystem)

Internal structure or function, interface may change.

Function that updates the minimum-distance counters in R

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

Internal structure or function, interface may change.

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})

Internal structure or function, interface may change.

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.writexyzMethod
writexyz(x::Vector{T}, file::String) where T <: AbstractVector

Internal structure or function, interface may change.

Print test xyz file.

source
diff --git a/dev/index.html b/dev/index.html index d136b7ac..4789b85c 100644 --- a/dev/index.html +++ b/dev/index.html @@ -16,4 +16,4 @@
Kirkwood-Buff integrals of an ionic liquid solvating a protein in different conformational states.

-

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 250b8387..de65fa1e 100644 --- a/dev/installation/index.html +++ b/dev/installation/index.html @@ -9,4 +9,4 @@ using Plots # 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 accronym. For example:

import ComplexMixtures as CM
-CM.mddf(...)
+CM.mddf(...) diff --git a/dev/mddf/index.html b/dev/mddf/index.html index 825aca21..5113c940 100644 --- a/dev/mddf/index.html +++ b/dev/mddf/index.html @@ -1,4 +1,4 @@ Computing the MDDF · ComplexMixtures.jl

Computing the Minimum-Distance Distribution Function

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

It is run with the following command:

results = mddf(trajectory)  

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

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

dbulk defines the distance from the solute above which the user believes that the reference solute molecule does not significantly anymore the structure of the solvent. The default value is 10 Angstroms, but for large solvent molecules this might not be enough. To increase dbulk, use:

options = Options(dbulk=15.)
 results = mddf(trajectory,options)

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

options = Options(stride=5)
-results = mddf(trajectory,options)

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

+results = mddf(trajectory,options)

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

diff --git a/dev/multiple/index.html b/dev/multiple/index.html index a3a87bb2..b325377c 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 4aa13304..54930e06 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)

Common options that the user might want to set:

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.

Options that most users will probably never change:

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.

+results = mddf(trajectory,options)

Common options that the user might want to set:

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.

Options that most users will probably never change:

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.

diff --git a/dev/parallel/index.html b/dev/parallel/index.html index 6ade9944..8349991c 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 auto option:

julia -t auto

The computation will use a number of threads equal to the number of physical cores of the computer. The number of computation threads to be used can be set by the Options(nthreads=N) parameter, where N is an integer. Hyperthreading (using more threads than physical CPUs) usually does not provide a significant speedup, and can be detrimental in some cases.

To directly run a script in parallel, use:

julia -t auto example.jl
Note

The number of threads used for computation of the MDDF is the number of physical CPUs of the computer, which are obtained programmatically. Most times the use of hyper-threading is not beneficial. Adjust the number of threads with the Options(nthreads=N) parameter.

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.1.

+

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.1.

diff --git a/dev/python/index.html b/dev/python/index.html index b83e4bb9..bafbf8cc 100644 --- a/dev/python/index.html +++ b/dev/python/index.html @@ -68,4 +68,4 @@ plt.plot(results.d, aliph_contributions) plt.xlabel("distance / Angs") plt.ylabel("MDDF") -plt.savefig("group_contributions.png")
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")
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 b8e37402..19a30bd5 100644 --- a/dev/quickguide/index.html +++ b/dev/quickguide/index.html @@ -46,4 +46,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 / \AA",ylabel="MDDF") 

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 dd76c0a6..0e378cc1 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. 117945, 2021. [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, neighbour 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. 117945, 2021. [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, neighbour 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 4db771cf..bf7a4907 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 soluteSolSummaryContains the number of atoms, number of atoms per molecule and number of molecules of the solute.
solventProperties of the solvent.SolSummaryContains 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
+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 soluteSolSummaryContains the number of atoms, number of atoms per molecule and number of molecules of the solute.
solventProperties of the solvent.SolSummaryContains 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
diff --git a/dev/save/index.html b/dev/save/index.html index fbf64e4f..8a9276fa 100644 --- a/dev/save/index.html +++ b/dev/save/index.html @@ -1,2 +1,2 @@ -Save and load · ComplexMixtures.jl

Save and load results

Three functions serve the purpose of saving and loading the results obtained with ComplexMixtures:

Save data to recover it later

save(results,"results.json")

where results is the output data structure of the mddf() calculation, and results.json is the output file to be created. The file is written in JSON format, thus is not naturally human-readable.

Load saved data

results = load("results.json")

The load function reads the output of the save function above, and restores the results data structure.

Write data in a human-readable format

If you Want the results to be written as simple ASCII tables such that you can read them with another analysis program, plotting graphic, or just want to inspect the data visually, use:

write(results,"results.dat")

Three files will be created by this function:

results.dat: Contains the main results, as the MDDF and KB-integral data.

results-ATOM_CONTRIB_SOLVENT.dat: contains the contribution of each atom type of the solvent to the MDDF.

results-ATOM_CONTRIB_SOLUTE.dat: contains the contribution of each atom type of the solute to the MDDF.

+Save and load · ComplexMixtures.jl

Save and load results

Three functions serve the purpose of saving and loading the results obtained with ComplexMixtures:

Save data to recover it later

save(results,"results.json")

where results is the output data structure of the mddf() calculation, and results.json is the output file to be created. The file is written in JSON format, thus is not naturally human-readable.

Load saved data

results = load("results.json")

The load function reads the output of the save function above, and restores the results data structure.

Write data in a human-readable format

If you Want the results to be written as simple ASCII tables such that you can read them with another analysis program, plotting graphic, or just want to inspect the data visually, use:

write(results,"results.dat")

Three files will be created by this function:

results.dat: Contains the main results, as the MDDF and KB-integral data.

results-ATOM_CONTRIB_SOLVENT.dat: contains the contribution of each atom type of the solvent to the MDDF.

results-ATOM_CONTRIB_SOLUTE.dat: contains the contribution of each atom type of the solute to the MDDF.

diff --git a/dev/search/index.html b/dev/search/index.html index 45f3e6de..ad5c3c48 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · ComplexMixtures.jl

Loading search...

    +Search · ComplexMixtures.jl

    Loading search...

      diff --git a/dev/selection/index.html b/dev/selection/index.html index 31825bf8..88092b4e 100644 --- a/dev/selection/index.html +++ b/dev/selection/index.html @@ -8,4 +8,4 @@ solute = Selection(protein,nmols=1)

      If the solvent is, for instance, water, the indexes of the water molecules can be obtained with:

      water = PDBTools.select(atoms,"water")
       solvent = Selection(water,natomspermol=3)

      or, alternatively, a more compact syntax can be used, for example:

      water = PDBTools.select("system.pdb","resname TIP3P")
       solvent = Selection(water,natomspermol=3)

      or even providing just the names of the input file and selection, which will run PDBTools in background:

      solvent = Selection("sytem.pdb","water",water,natomspermol=3)
      Warning

      The selection syntax of PDBTools is somewhat limited. Verify if the selections correspond to the the desired sets of atoms every time.

      Using VMD

      VMD is a very popular and powerful package for visualization of simulations. It contains a very versatile library to read topologies and trajectory files, and a powerful selection syntax. We provide here a wrapper to VMD which allows using its capabilities.

      For example, the solute can be defined with:

      indexes, names = VMDselect("./system.gro","protein",vmd="/usr/bin/vmd")
      -solute = Selection(indexes,names,nmols=1)

      The main advantage here is that all the file types that VMD supports are supported. But VMD needs to be installed and is run in background, and it takes a few seconds.

      Warning

      VMD uses 0-based indexing and VMDselect adjusts that. However, if a selection is performed by index, as with index 1, VMD will select the second atom, and the output will be [2]. Selections by type, name, segment, residue name, etc, won't be a problem.

      +solute = Selection(indexes,names,nmols=1)

      The main advantage here is that all the file types that VMD supports are supported. But VMD needs to be installed and is run in background, and it takes a few seconds.

      Warning

      VMD uses 0-based indexing and VMDselect adjusts that. However, if a selection is performed by index, as with index 1, VMD will select the second atom, and the output will be [2]. Selections by type, name, segment, residue name, etc, won't be a problem.

      diff --git a/dev/tools/index.html b/dev/tools/index.html index fbfe8247..d8b64a05 100644 --- a/dev/tools/index.html +++ b/dev/tools/index.html @@ -88,4 +88,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 df22f9d5..b5441b00 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 Selection 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")
      +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 Selection 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")