Mappings

Atom bijection

BiochemicalAlgorithms.TrivialAtomBijectionType
TrivialAtomBijection{T} <: AbstractAtomBijection{T}

Mutable representation of a bijection of atoms based on the order of atoms in the individual atom containers.

Public fields

  • atoms_A::AtomTable{T}
  • atoms_B::AtomTable{T}

Constructors

TrivialAtomBijection{T}(A::AbstractAtomContainer{T}, B::AbstractAtomContainer{T}) where T

Creates a new TrivialAtomBijection{T} with the atoms of the individual atom containers.

TrivialAtomBijection{T}(atoms_A, B::AbstractAtomContainer{T}) where T

Creates a new TrivialAtomBijection{T}based on the unique set of atom numbers of atoms_A.

source

Rigid Mapping

BiochemicalAlgorithms.RigidTransformType
struct RigidTransform{T<:Real}

Mutable representation of a rigid transform.

Fields

  • rotation::RotMatrix3
  • translation::Vector3

Constructors

RigidTransform{T}(r::RotMatrix3{T}, t::Vector3{T}) where {T<:Real}

Creates a new RigidTransform{T} with the given parameters.

RigidTransform{T}(r::Matrix3{T}, t::Vector3{T}) where {T<:Real} 

Creates a new RigidTransform{T} and converts the given Matrix3{T} to a RotMatrix3 object.

Note

From the documentation of Rotations.jl:

The given Matrix3{T} should have the property I =RR^T, but this isn't enforced by the constructor.

RigidTransform(r::Matrix3, t::Vector3) = RigidTransform{Float32}(r, t)

Creates a new RigidTransform{Float32} with the given parameters.

source
BiochemicalAlgorithms.compute_rmsdFunction
compute_rmsd(f::AbstractAtomBijection{T<:Real}) -> Any

Computes the root mean square deviation (RMSD) of the given AbstractAtomBijection.

source
compute_rmsd(
    A::AbstractAtomContainer,
    B::AbstractAtomContainer
) -> Any

Computes the root mean square deviation (RMSD) based on two sets of atoms.

Note

AtomContainers must have the same number of atoms.

source
BiochemicalAlgorithms.compute_rmsd_minimizerFunction
compute_rmsd_minimizer(
    f::AbstractAtomBijection{T<:Real}
) -> RigidTransform
compute_rmsd_minimizer(
    f::AbstractAtomBijection{T<:Real},
    mini::Type{<:AbstractRMSDMinimizer}
) -> RigidTransform

Computes the transformation required to map two atom sets given as the atom bijection.

Returns a RigidTransformation object. The translation is given by the difference of the means of the atom sets. The corresponding rotation matrix can be computed by the approach of Coutsias et al. (default) or Kabsch, implemented by RMSDMinimizerCoutsias and RMSDMinimizerKabsch, respectively. Both implementation rely on solving an eigen value problem. Coutsias et al. represents rotation matrices as quaternions (use of Package Quaternions.jl).

Note

In order to map the two atom sets with the resulting RigidTransform the system to be mapped hast to be transferred to the origin first (before the RigidTransform is applied).

source
BiochemicalAlgorithms.map_rigid!Function
map_rigid!(
    A::AbstractAtomContainer{T<:Real},
    B::AbstractAtomContainer{T<:Real};
    heavy_atoms_only
) -> AbstractAtomContainer{T} where T<:Real

Maps AbstractAtomContainer A onto AbstractAtomContainer B by first moving A to the origin and then computing the RigidTransform by using RMSDMinimizerCoutsias. Returns the mapped AbstractAtomContainer A.

source
BiochemicalAlgorithms.match_pointsFunction
match_points(
    w1::StaticArraysCore.SArray{Tuple{3}, T<:Real, 1, 3},
    w2::StaticArraysCore.SArray{Tuple{3}, T<:Real, 1, 3},
    w3::StaticArraysCore.SArray{Tuple{3}, T<:Real, 1, 3},
    v1::StaticArraysCore.SArray{Tuple{3}, T<:Real, 1, 3},
    v2::StaticArraysCore.SArray{Tuple{3}, T<:Real, 1, 3},
    v3::StaticArraysCore.SArray{Tuple{3}, T<:Real, 1, 3}
) -> Tuple{Any, Any}

The transformation maps

  1. the point w1 onto the point v1 and
  2. the point w2 onto the ray that starts in v1 and goes through v2
  3. the point w3 into the plane generated by v1, v2 and v3
source
BiochemicalAlgorithms.rigid_transform!Function
rigid_transform!(
    m::AbstractAtomContainer{T<:Real},
    transform::RigidTransform{T<:Real}
) -> AbstractAtomContainer{T} where T<:Real

Performs a rigid transformation on the atom positions of m. First, atoms are rotated by the rotation matrix of the RigidTransform r followed by translation.

source
BiochemicalAlgorithms.translate!Function
translate!(
    m::AbstractAtomContainer{T<:Real},
    t::StaticArraysCore.SArray{Tuple{3}, T<:Real, 1, 3}
) -> AbstractAtomContainer{T} where T<:Real

Moves the atoms of the atom container to new positions by adding the values given by the vector t the current positions.

source