Internals
How did you get here?!
The following docstrings are a dump for non-exported private & internal functions. These provide basic internal functionality that should rarely be employed by an end-user. In either case, docstrings exist to explain the inner-workings of methods for potential developers.
ProtoSyn.Calculators.TorchANI.r_xml_travel!
— Functionr_xml_travel!(xml::Union{XMLDocument, XMLElement}, query::String, results::Vector{T}) where {T <: AbstractFloat}
Recursively travel the XMLDocument or XMLElement and gather all entrys of label type query
, pushing them to the results
vector (a parse for the correct T type is attempted).
ProtoSyn.Clustering.dunn_index
— Functiondunn_index(intra::Vector{T}, inter::Vector{T}) where {T <: AbstractFloat}
Given a vector with all intra-distances of all clusters considered and an inter-distance matrix between all clusters considered, return the Dunn Index. Note: The higher the Dunn Index, the better is the clustering.
Examples
julia> ProtoSyn.Clustering.dunn_index(intra, inter)
1.0097267039046134
See also
ProtoSyn.Clustering.davies_bouldin_index
ProtoSyn.Calculators.get_available_energy_function_components
— Functionget_available_energy_function_components([m::Module = ProtoSyn.Calculators])
Returns all available EnergyFunctionComponent
instances in the provided Module
m
(defaults to ProtoSyn.Calculators
). Recursivelly searches any inner Module
.
See also
show_available_energy_function_components
Examples
julia> ProtoSyn.Calculators.get_available_energy_function_components(ProtoSyn.Calculators) 14-element Vector{Function}: get_default_custom_ref_energy (generic function with 1 method) get_default_coulomb (generic function with 1 method) (...)
Base.resize!
— Methodresize!(verlet_list::VerletList, n::Int)
Resize a Verlet list to hold 'n' particles. If 'n' is higher than the
current length of the list, appends 0's.
Example:
resize!(vl, 8)
ProtoSyn.Common
— ModuleThe Common module stores functions with higher levels of abstraction and
that are common practice in ProtoSyn algorithms.
ProtoSyn.AbstractContainer
— TypeAbstractContainer{T}
Supertype for a container of elements of type T
.
ProtoSyn.Peptides.Calculators.Caterpillar.nc_scalling_exposed_only
— Functionnc_scalling_exposed_only(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all buried residues contributions are set to 0.0. The exposed residues contribution is a scaled difference between the given Ωi
and the cut-off Ω
, multiplied by the hydrophobicity_map_value
.
See also
nc_non_scalling_exposed_only
nc_scalling_all_contributions
nc_non_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nc_scalling_exposed_only(10.0, hydrophobicity_map_value = 1.0, Ω = 5.0)
5.0
ProtoSyn.Peptides.Calculators.Caterpillar.nv_scalling_exposed_only
— Functionnv_scalling_exposed_only(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all buried residues contributions are set to 0.0. The exposed residues contribution is a scaled difference between the given Ωi
and the cut-off Ω
, multiplied by the hydrophobicity_map_value
.
See also
nv_non_scalling_exposed_only
nv_scalling_all_contributions
nv_non_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nv_scalling_exposed_only(10.0, hydrophobicity_map_value = 1.0, Ω = 5.0)
5.0
ProtoSyn.Peptides.Calculators.Caterpillar.nc_non_scalling_exposed_only
— Functionnc_non_scalling_exposed_only(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all buried residues contributions are set to 0.0. The exposed residues contribution is the non scaled hydrophobicity_map_value
.
See also
nc_scalling_exposed_only
nc_scalling_all_contributions
nc_non_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nc_non_scalling_exposed_only(10.0, hydrophobicity_map_value = 1.0, Ω = 5.0)
1.0
ProtoSyn.Peptides.Calculators.Caterpillar.nv_non_scalling_exposed_only
— Functionnv_non_scalling_exposed_only(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all buried residues contributions are set to 0.0. The exposed residues contribution is the non scaled hydrophobicity_map_value
.
See also
nv_scalling_exposed_only
nv_scalling_all_contributions
nv_non_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nv_non_scalling_exposed_only(10.0, hydrophobicity_map_value = 1.0, Ω = 5.0)
1.0
ProtoSyn.Peptides.Calculators.Caterpillar.nc_scalling_all_contributions
— Functionnc_scalling_all_contributions(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all residue contributions are considered. Both the exposed and buried residues contributions are a scaled difference between the given Ωi
and the cut-off Ω
, multiplied by the hydrophobicity_map_value
.
See also
nc_scalling_exposed_only
nc_non_scalling_exposed_only
nc_non_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nc_scalling_all_contributions(10.0, hydrophobicity_map_value = 1.0, Ω = 20.0)
-10.0
ProtoSyn.Peptides.Calculators.Caterpillar.nv_scalling_all_contributions
— Functionnv_scalling_all_contributions(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all residue contributions are considered. Both the exposed and buried residues contributions are a scaled difference between the given Ωi
and the cut-off Ω
, multiplied by the hydrophobicity_map_value
.
See also
nv_scalling_exposed_only
nv_non_scalling_exposed_only
nv_non_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nv_scalling_all_contributions(10.0, hydrophobicity_map_value = 1.0, Ω = 20.0)
-10.0
ProtoSyn.Peptides.Calculators.Caterpillar.nc_non_scalling_all_contributions
— Functionnc_non_scalling_all_contributions(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all residue contributions are considered. Both the exposed and buried residues contributions are the non scaled hydrophobicity_map_value
.
See also
nc_scalling_exposed_only
nc_non_scalling_exposed_only
nc_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nc_non_scalling_all_contributions(10.0, hydrophobicity_map_value = 1.0, Ω = 20.0)
-1.0
ProtoSyn.Peptides.Calculators.Caterpillar.nv_non_scalling_all_contributions
— Functionnv_non_scalling_all_contributions(Ωi::Union{Int, T}; hydrophobicity_map_value::T = 0.0, Ω::Union{Int, T} = 0.0) where {T <: AbstractFloat}
Return the hydrophobicity weight w2
where all residue contributions are considered. Both the exposed and buried residues contributions are the non scaled hydrophobicity_map_value
.
See also
nv_scalling_exposed_only
nv_non_scalling_exposed_only
nv_scalling_all_contributions
Examples
julia> ProtoSyn.Peptides.Calculators.Caterpillar.nv_non_scalling_all_contributions(10.0, hydrophobicity_map_value = 1.0, Ω = 20.0)
-1.0
ProtoSyn.cross2d
— Functioncross2d(m1::Mask{T}, m2::Mask{T}) where {T <: AbstractContainer}
Combine both the provided Mask
instances m1
and m2
, so that the returned result is a 2D Mask where each position (N, M) is the result of combining m1[N] & m2[M]
.
cross2d(m1::Mask{T}) where {T <: AbstractContainer}
If only 1 Mask
m1
is provided, return the cross2d
result of m1
and m1'
(m1
transpose).
See also
Examples
julia> m = ProtoSyn.Mask{Atom}(4); m[1] = m[3] = true; m
ProtoSyn.Mask{Atom}(4,)
4-element BitArray{1}:
1
0
1
0
julia> ProtoSyn.cross2d(m)
ProtoSyn.Mask{Atom}(4, 4)
4×4 BitArray{2}:
1 0 1 0
0 0 0 0
1 0 1 0
0 0 0 0
ProtoSyn.@cross
— Macro@macroexpand @cross u outu au b_u
quote out1 = a2 * b3 - a3 * b2 out2 = a3 * b1 - a1 * b3 out3 = a1 * b2 - a2 * b_1 end
ProtoSyn.@dot
— Macro@macroexpand @dot u au bu
:(a1 * b1 + a2 * b2 + a3 * b3)
ProtoSyn.Calculators.@reduce
— Macro@reduce(n::Int, op::Symbol, ex::Expr)
Wrapping macro for @ncall. Is equivalent and generates
op(ex_1, ..., ex_n)
Example:
@reduce 2 (+) u -> v_u^2
> Generates +(v_1^2, v_2^2)
ProtoSyn.get_lead
— Functionget_lead(level_code::Opt{LevelCode} = nothing)
Auxiliary function, uses level codes to show inheritance in the terminal for complex types.
ProtoSyn.Calculators.distance_matrix_kernel
— Functiondistance_matrix_kernel(coords::CuDeviceArray{T}, distance_matrix::CuDeviceMatrix{T}, n::Int) where {T <: AbstractFloat}
Kernel for CUDA2 acceleration of `distancematrix` calculation.
ProtoSyn.Clustering.complete_diameter_distances
— Functioncomplete_diameter_distances([T], assignments::Vector{Int}, rm::Matrix{T}) where {T <: AbstractFloat}
Given an assignment
vector (see Clustering
package) and a RMSD matrix (see ProtoSyn.Clustering.rmsd_matrix
), return the intra- and inter-cluster complete diameter distances. Note: The complete diameter distance is the distance between the two most remote objects is the same cluster (intra-distance) or in two clusters (inter-distance).
Examples
julia> intra, inter = ProtoSyn.Clustering.complete_diameter_distances(clusters.assignments, rmsd_matrix)
([8.611851425604167, 13.379156063323348], [0.0 13.509291152844908; 0.0 0.0])
See also
ProtoSyn.Clustering.average_diameter_distances
ProtoSyn.Clustering.davies_bouldin_index
— Functiondavies_bouldin_index(intra::Vector{T}, inter::Vector{T}) where {T <: AbstractFloat}
Given a vector with all intra-distances of all clusters considered and an inter-distance matrix between all clusters considered, return the Davies-Bouldin Index. Note: The lower the Davies-Bouldin Index, the better is the clustering.
Examples
julia> ProtoSyn.Clustering.davies_bouldin_index(intra, inter)
0.8139215907082012
See also
ProtoSyn.Clustering.davies_bouldin_index
ProtoSyn.Clustering.rmsd_matrix
— Functionrmsd_matrix([T], poses::Vector{Pose})
rmsd_matrix([T], poses::Vector{Pose}, selection::AbstractSelection)
Given a vector of Pose
s, calculate the pairwise RMSD (see ProtoSyn.rmsd
) values between all members, after alignment (see ProtoSyn.align!
for more information). If an optional type T <: AbstractFloat is given, use this type. Otherwise, will use ProtoSyn.Units.defaultFloat. If an AbstractSelection
(selection
) is given, use that sub-set of atoms for the alignment and RMSD calculation.
Examples
julia> a = ProtoSyn.Clustering.rmsd_matrix(poses, an"CA")
3×3 Array{Float64,2}:
0.0 7.18633 9.9984
7.18633 0.0 7.01093
9.9984 7.01093 0.0
See also
ProtoSyn.align!
ProtoSyn.rmsd
ProtoSyn.Clustering.complete_diameter_distances
ProtoSyn.Clustering.average_diameter_distances
ProtoSyn.Clustering.average_diameter_distances
— Functionaverage_diameter_distances([T], assignments::Vector{Int}, rm::Matrix{T}) where {T <: AbstractFloat}
Given an assignment
vector (see Clustering
package) and a RMSD matrix (see ProtoSyn.Clustering.rmsd_matrix
), return the intra- and inter-cluster average diameter distances. Note: The average diameter distance is the average linkage distance between all the objects is the same cluster (intra-distance) or all the objects in two clusters (inter-distance).
Examples
julia> intra, inter = ProtoSyn.Clustering.average_diameter_distances(clusters.assignments, rmsd_matrix)
([6.19984080693077, 7.566813059033408], [0.0 8.551225161132669; 0.0 0.0])
See also
ProtoSyn.Clustering.complete_diameter_distances
ProtoSyn.tile
— Functiontile(m::Mask{T}) where {T <: AbstractContainer}
Repeat and return the content of the provided Mask
m
N times, where N is the length of m
, along the horizontal dimension. Note that this function expects a 1D Mask
as input, otherwise will just return the received Mask
.
See also
Examples
julia> m = ProtoSyn.Mask{Atom}(4); m[1] = true; m
ProtoSyn.Mask{Atom}(4,)
4-element BitArray{1}:
1
0
0
0
julia> ProtoSyn.tile(m)
ProtoSyn.Mask{Atom}(4, 4)
4×4 BitArray{2}:
1 1 1 1
0 0 0 0
0 0 0 0
0 0 0 0
ProtoSyn.tile!
— Functiontile!(m::Mask{T}) where {T <: AbstractContainer}
Repeat the content of the provided Mask
m
N times, where N is the length of m
. Note that this function expects a 1D Mask
as input, otherwise will just return the received Mask
. Overwrite the contents of the input Mask
with the output.
See also
Examples
julia> m = ProtoSyn.Mask{Atom}(4); m[1] = true; m
ProtoSyn.Mask{Atom}(4,)
4-element BitArray{1}:
1
0
0
0
julia> ProtoSyn.tile!(m)
ProtoSyn.Mask{Atom}(4, 4)
4×4 BitArray{2}:
1 1 1 1
0 0 0 0
0 0 0 0
0 0 0 0
ProtoSyn.Mutators
— ModuleMutators
Mutators are complex functions that perform 1 specific change in a system. Currently, ProtoSyn-base makes available the following mutators:
DihedralMutator
CrankshaftMutator
RotationRigidBodyMutator
TranslationRigidBodyMutator
BackrubMutator
CompoundMutator
ProtoSyn.Peptides.Mutators
— ModuleMutators
Mutators are complex functions that perform 1 specific change in a system. Besides the list of available Mutators at ProtoSyn.Mutators, the Peptides module adds the following Mutators:
RotamerMutator
DesignMutator
ProtoSyn.Peptides
— ModulePeptides
The Peptides modules introduces Calculators
, Mutators
and Drivers
(among other methods) specific for proteins and peptides.
ProtoSyn.Materials
— ModuleMaterials
The Materials modules introduces several methods related to different types of materials (such as atomic lattices, etc).
ProtoSyn.GMX
— ModuleGMX (Module)
Holds utilitary methods for preparing and launching GROMCAS simulations.
ProtoSyn.Peptides.GMX
— ModuleGMX (module)
Holds auxiliary methods for generating .itp, .top and other necessary files for GROMACS simulations.
ProtoSyn.GMX.check_installation
— Functioncheck_installation()
Checks the current machine for necessary packages: gmx
, antechamber
& acpype
. Make sure these programs are in the system's PATH.
Examples
julia> ProtoSyn.GMX.check_installation()
✓ All necessary packages were found!
ProtoSyn.Calculators.neighbours
— Functionneighbours(verlet_list::VerletList, atom_index::Int)
Return a list of the neighbouring Atom
instances of Atom
with :index
atom_index
, according to the provided VerletList
verlet_list
.
Examples
julia> ProtoSyn.Calculators.neighbours(vl, 1)
11-element Vector{Int64}:
2
3
4
5
6
7
8
10
11
12
13
ProtoSyn.Calculators.Restraints
— Modulemodule Restraints
Contains restraint energy components, such as bond_distance_restraint
.
ProtoSyn.print_diagnose_results
— Functionprint_diagnose_results(title::String, issues::Vector{String}, init_level_code::LevelCode, level::Int)
Prints a list of issues
(under the scop of title
grouping) in a stylized way (uses init_level_code
and adds inner LevelCode
instances at level
).
This function is intended to be employed from diagnose
, and not as a standalone.
Examples
julia> ProtoSyn.print_diagnose_results("Charges", ["Missing charges", "Charges sum is not 0.0"], LevelCode(), 4)
|
└── • Charges (2 issues identified)
├── Missing charges
└── Charges sum is not 0.0
ProtoSyn.XMLRPC.ClientProxy
— TypeClientProxy(host::String, port::Int)
Instantiate a client proxy listening on host
and port
. This object is meant to act as a proxy to a remote service implementing the XML/RPC protocol, and was designed to work with Python and PyMOL. For more detailed information, please read:
https://blog.papercut.com/write-xml-rpc-clients/
https://wiki.python.org/moin/XmlRpc
Examples
julia> ProtoSyn.XMLRPC.ClientProxy("http://localhost", 50000)
ProtoSyn.XMLRPC.ClientProxy("http://localhost", 50000, "http://localhost:50000")
ProtoSyn.read_yml
— Functionread_yml(_filename::String)
Open and read the contents of a .yml file.
Examples
julia> ProtoSyn.read_yml("resources/Peptides/grammars.yml")
Dict{Any, Any} with 2 entries:
(...)
ProtoSyn.gpu_allocation
— Functiongpu_allocation()
Return the current fraction of the GPU memory allocated (in range [0, 1]).
Examples
julia> ProtoSyn.gpu_allocation()
0.07821749405343822
ProtoSyn.promote
— Functionpromote(sele::AbstractSelection, ::Type{T2}, [aggregator::Function = any]) where {T2 <: AbstractContainer}
Return a PromoteSelection
instance for selection sele
, promoting to the requested type T2 <: AbstractContainer
. If this is an upwards promotion, use the given aggregator
function (default: any
).
Examples
julia> ProtoSyn.promote(rn"ALA", Atom)
PromoteSelection ❯ From Residue to Atom
└── FieldSelection › Residue.name = ALA
promote(m1::Mask{T1}, m2::Mask{T2}, container::AbstractContainer) where {T1, T2}
Promote one of the 2 given Masks
(m1
and m2
) to the lowest ranking common type (Ex. promote(m1::Mask{Residue}, m2::Mask{Atom}) => (Mask{Atom}, Mask{Atom)
).
Examples
julia> m1 = an"CB"(pose);
julia> m2 = rn"LEU"(pose);
julia> ProtoSyn.promote(m1, m2, pose.graph);
promote(mask::Mask{T1}, ::Type{T2}, container::AbstractContainer, f::Function = any)::Mask where {T1 <: AbstractContainer, T2 <: AbstractContainer}
Cast a Mask
of type T1
to be of type T2
, in the context of the given container
. If casting to a higher ranking type (upwards promotion - Ex. Atom -> Residue), a function f
establishes the grouping operation (any
occurrence (by default) or all
occurrences of lower ranking type must be true
to set the higher ranking entry to true
.)
Examples
julia> m1 = an"CB"(pose);
julia> ProtoSyn.promote(m1, Residue, pose.graph);