System representation

Abstract types

Common functions

BiochemicalAlgorithms.has_propertyFunction
has_property(
    ac::AbstractSystemComponent,
    key::Symbol
) -> Any

Returns a Bool indicating whether the given system component has the given property.

source
BiochemicalAlgorithms.get_propertyFunction
get_property(
    ac::AbstractSystemComponent,
    key::Symbol
) -> Any

Returns the property associated with the given key in ac.

source
get_property(
    ac::AbstractSystemComponent,
    key::Symbol,
    default
) -> Any

Returns the property associated with the given key in ac. If no such property exists, returns default.

source
BiochemicalAlgorithms.has_flagFunction
has_flag(ac::AbstractSystemComponent, flag::Symbol) -> Any

Returns a Bool indicating whether the given system component has the given flag.

source

Systems

BiochemicalAlgorithms.SystemType
mutable struct System{T} <: AbstractAtomContainer{T}

Mutable representation of a biomolecular system.

Fields

  • name::String
  • properties::Properties
  • flags::Flags

Constructors

System(name::String = "", properties::Properties = Properties(), flags::Flags = Flags())

Creates a new and empty System{Float32}.

System{T}(name::String = "", properties::Properties = Properties(), flags::Flags = Flags())

Creates a new and empty System{T}.

source
Base.parentMethod
parent(::Atom)
parent(::Bond)
parent(::Chain)
parent(::Fragment)
parent(::Molecule)
parent(::Nucleotide)
parent(::Residue)
parent(::System)

Returns the System{T} containing the given object.

source
BiochemicalAlgorithms.parent_systemFunction
parent_system(::Atom)
parent_system(::Bond)
parent_system(::Chain)
parent_system(::Fragment)
parent_system(::Molecule)
parent_system(::Nucleotide)
parent_system(::Residue)
parent_system(::System)

Returns the System{T} containing the given object. Alias for Base.parent.

source

Atoms

BiochemicalAlgorithms.AtomType
Atom{T} <: AbstractSystemComponent{T}

Mutable representation of an individual atom in a system.

Public fields

  • idx::Int
  • number::Int
  • element::ElementType
  • name::String
  • atom_type::String
  • r::Vector3{T}
  • v::Vector3{T}
  • F::Vector3{T}
  • formal_charge::Int
  • charge::T
  • radius::T

Private fields

  • properties::Properties
  • flags::Flags
  • frame_id::Int
  • molecule_idx::MaybeInt
  • chain_idx::MaybeInt
  • fragment_idx::MaybeInt
  • nucleotide_idx::MaybeInt
  • residue_idx::MaybeInt

Constructors

Atom(
    ac::AbstractAtomContainer{T}
    number::Int,
    element::ElementType;
    # keyword arguments
    name::String = "",
    atom_type::String = "",
    r::Vector3{T} = Vector3{T}(0, 0, 0),
    v::Vector3{T} = Vector3{T}(0, 0, 0),
    F::Vector3{T} = Vector3{T}(0, 0, 0),
    formal_charge::Int = 0,
    charge::T = zero(T),
    radius::T = zero(T),
    properties::Properties = Properties(),
    flags::Flags = Flags(),
    frame_id::Int = 1
    molecule_idx::MaybeInt = nothing,
    chain_idx::MaybeInt = nothing,
    fragment_idx::MaybeInt = nothing,
    nucleotide_idx::MaybeInt = nothing,
    residue_idx::MaybeInt = nothing
)

Creates a new Atom{T} in the given atom container.

Atom(
    number::Int,
    element::ElementType;
    kwargs...
)

Creates a new Atom{Float32} in the default system. Supports the same keyword arguments as above.

source
BiochemicalAlgorithms.AtomTableType
AtomTable{T} <: AbstractSystemComponentTable{T}

Tables.jl-compatible representation of system atoms (or a subset thereof). Atom tables can be generated using atoms or filtered from other atom tables (via Base.filter).

Public columns

  • idx::AbstractVector{Int}
  • number::AbstractVector{Int}
  • element::AbstractVector{ElementType}
  • name::AbstractVector{String}
  • atom_type::AbstractVector{String}
  • r::AbstractVector{Vector3{T}}
  • v::AbstractVector{Vector3{T}}
  • F::AbstractVector{Vector3{T}}
  • formal_charge::AbstractVector{Int}
  • charge::AbstractVector{T}
  • radius::AbstractVector{T}

Private columns

  • properties::AbstractVector{Properties}
  • flags::AbstractVector{Flags}
  • frame_id::AbstractVector{Int}
  • molecule_idx::AbstractVector{MaybeInt}
  • chain_idx::AbstractVector{MaybeInt}
  • fragment_idx::AbstractVector{MaybeInt}
  • nucleotide_idx::AbstractVector{MaybeInt}
  • residue_idx::AbstractVector{MaybeInt}
source
BiochemicalAlgorithms.atom_by_idxFunction
atom_by_idx(sys::System{T}, idx::Int64) -> Atom

Returns the Atom{T} associated with the given idx in sys. Throws a KeyError if no such atom exists.

source
BiochemicalAlgorithms.atom_by_nameFunction
atom_by_name(
    ac::AbstractAtomContainer{T},
    name::String;
    frame_id
) -> Union{Nothing, Atom}

Returns the first Atom{T} associated with the given name in ac. Returns nothing if no such atom exists.

Supported keyword arguments

  • frame_id::MaybeInt = 1: Any value other than nothing limits the result to atoms matching this frame ID.
source
BiochemicalAlgorithms.atomsFunction
atoms(::Chain)
atoms(::Fragment)
atoms(::Molecule)
atoms(::Nucleotide)
atoms(::Residue)
atoms(::System)

Returns an AtomTable{T} containing all atoms of the given atom container.

Supported keyword arguments

  • frame_id::MaybeInt = 1
  • molecule_idx::Union{MaybeInt, Some{Nothing}} = nothing
  • chain_idx::Union{MaybeInt, Some{Nothing}} = nothing
  • fragment_idx::Union{MaybeInt, Some{Nothing}} = nothing
  • nucleotide_idx::Union{MaybeInt, Some{Nothing}} = nothing
  • residue_idx::Union{MaybeInt, Some{Nothing}} = nothing

All keyword arguments limit the results to atoms matching the given IDs. Keyword arguments set to nothing are ignored. You can use Some(nothing) to explicitly filter for ID values of nothing.

source
atoms(
    substruct::Substructure{T, A} where A<:AbstractAtomContainer{T};
    frame_id,
    molecule_idx,
    chain_idx,
    fragment_idx,
    nucleotide_idx,
    residue_idx
) -> SystemComponentTable{T, C} where {T, C<:Atom{T}}

Returns an AtomTable for all of the given system's atoms matching the given criteria (value or missing). Fields given as nothing are ignored. The returned table contains all public and private atom fields.

source
BiochemicalAlgorithms.is_bound_toFunction
is_bound_to(a1::Atom, a2::Atom) -> Bool

Decides if two atoms are bound to each other. Hydrogen bonds (has_flag(bond, :TYPE__HYDROGEN)) are ignored.

source
BiochemicalAlgorithms.is_geminalFunction
is_geminal(a1::Atom, a2::Atom) -> Union{Missing, Bool}
Decides if two atoms are geminal.

Two atoms are geminal if they do not share a common bond but both have a bond to a third atom. For example the two hydrogen atoms in water are geminal. Hydrogen bonds (has_flag(bond, :TYPE__HYDROGEN)) are ignored.

source
BiochemicalAlgorithms.is_vicinalFunction
is_vicinal(a1::Atom, a2::Atom) -> Bool

Decides if two atoms are vicinal.

Two atoms are vicinal if they are separated by three bonds (1-4 position). Hydrogen bonds (has_flag(bond, :TYPE__HYDROGEN)) are ignored.

source
BiochemicalAlgorithms.natomsFunction
natoms(::Chain)
natoms(::Fragment)
natoms(::Molecule)
natoms(::Nucleotide)
natoms(::Residue)
natoms(::System)

Returns the number of atoms in the given atom container.

Supported keyword arguments

See atoms

source
Base.push!Method
push!(::Fragment{T},   ::Atom{T})
push!(::Molecule{T},   ::Atom{T})
push!(::Nucleotide{T}, ::Atom{T})
push!(::Residue{T},    ::Atom{T})
push!(::System{T},     ::Atom{T})

Creates a copy of the given atom in the given atom container. The new atom is automatically assigned a new idx.

Supported keyword arguments

See atoms

source

Bonds

BiochemicalAlgorithms.BondType
Bond{T} <: AbstractAtomContainer{T}

Mutable representation of an individual bond in a system.

Public fields

  • idx::Int
  • a1::Int
  • a2::Int
  • order::BondOrderType

Private fields

  • properties::Properties
  • flags::Flags

Constructors

Bond(
    sys::System{T}, 
    a1::Int, 
    a2::Int, 
    order::BondOrderType;
    # keyword arguments
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Bond{T} in the given system.

Bond(
    a1::Int,
    a2::Int,
    order::BondOrderType;
    # keyword arguments
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Bond{Float32} in the default system.

source
BiochemicalAlgorithms.BondTableType
BondTable{T} <: AbstractSystemComponentTable{T}

Tables.jl-compatible representation of system bonds (or a subset thereof). Bond tables can be generated using bonds or filtered from other bond tables (via Base.filter).

Public columns

  • idx::AbstractVector{Int}
  • a1::AbstractVector{Int}
  • a2::AbstractVector{Int}
  • order::AbstractVector{BondOrderType}

Private columns

  • properties::AbstractVector{Properties}
  • flags::AbstractVector{Flags}
source
BiochemicalAlgorithms.bond_by_idxFunction
bond_by_idx(sys::System{T}, idx::Int64) -> Bond

Returns the Bond{T} associated with the given idx in sys. Throws a KeyError if no such bond exists.

source
BiochemicalAlgorithms.bondsFunction
bonds(::Chain)
bonds(::Fragment)
bonds(::Molecule)
bonds(::Nucleotide)
bonds(::Residue)
bonds(::System)

Returns a BondTable{T} containing all bonds of the given atom container where at least one associated atom is contained in the same container.

Supported keyword arguments

See atoms

source
bonds(::Atom)

Returns a BondTable{T} containing all bonds of the given atom.

source
BiochemicalAlgorithms.nbondsFunction
nbonds(::Chain)
nbonds(::Fragment)
nbonds(::Molecule)
nbonds(::Nucleotide)
nbonds(::Residue)
nbonds(::System)

Returns the number of bonds in the given atom container where at least one associated atom is contained in the same container.

Supported keyword arguments

See atoms

source
nbonds(::Atom)

Returns the number of bonds of the given atom.

source
Base.push!Method
push!(::AbstractAtomContainer, ::Bond{T})

Creates a copy of the given bond in the system associated with the given atom container. The new bond is automatically assigned a new idx.

source

Molecules

BiochemicalAlgorithms.MoleculeType
Molecule{T} <: AbstractAtomContainer{T}

Mutable representation of an individual molecule in a system.

Public fields

  • idx::Int
  • name::String

Private fields

  • properties::Properties
  • flags::Flags

Constructors

Molecule(
    sys::System{T};
    # keyword arguments
    name::String = "",
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Molecule{T} in the given system.

Molecule(;
    #keyword arguments
    name::String = "",
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Molecule{Float32} in the default system.

source
BiochemicalAlgorithms.MoleculeTableType
MoleculeTable{T} <: AbstractSystemComponentTable{T}

Tables.jl-compatible representation of system molecules (or a subset thereof). Molecule tables can be generated using molecules or filtered from other molecule tables (via Base.filter).

Public columns

  • idx::AbstractVector{Int}
  • name::AbstractVector{String}

Private columns

  • properties::AbstractVector{Properties}
  • flags::AbstractVector{Flags}
source
BiochemicalAlgorithms.molecule_by_idxFunction
molecule_by_idx(sys::System{T}, idx::Int64) -> Molecule

Returns the Molecule{T} associated with the given idx in sys. Throws a KeyError if no such molecule exists.

source
BiochemicalAlgorithms.parent_moleculeFunction
parent_molecule(::Atom)
parent_molecule(::Chain)
parent_molecule(::Fragment)
parent_molecule(::Nucleotide)
parent_molecule(::Residue)

Returns the Molecule{T} containing the given object. Returns nothing if no such molecule exists.

source
Base.push!Method
push!(::System{T}, ::Molecule{T})

Creates a copy of the given molecule in the given system. The new molecule is automatically assigned a new idx.

source

Chains

BiochemicalAlgorithms.ChainType
Chain{T} <: AbstractAtomContainer{T}

Mutable representation of an individual chain in a system.

Public fields

  • idx::Int
  • name::String

Private fields

  • properties::Properties
  • flags::Flags
  • molecule_idx::Int

Constructors

Chain(
    mol::Molecule{T};
    # keyword arguments
    name::String = "",
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Chain{T} in the given molecule.

source
BiochemicalAlgorithms.ChainTableType
ChainTable{T} <: AbstractSystemComponentTable{T}

Tables.jl-compatible representation of system chains (or a subset thereof). Chain tables can be generated using chains or filtered from other chain tables (via Base.filter).

Public columns

  • idx::AbstractVector{Int}
  • name::AbstractVector{String}

Private columns

  • properties::AbstractVector{Properties}
  • flags::AbstractVector{Flags}
  • molecule_idx::AbstractVector{Int}
source
BiochemicalAlgorithms.chain_by_idxFunction
chain_by_idx(sys::System{T}, idx::Int64) -> Chain

Returns the Chain{T} associated with the given idx in sys. Throws a KeyError if no such chain exists.

source
BiochemicalAlgorithms.chainsFunction
chains(::Molecule)
chains(::System; kwargs...)

Returns a ChainTable{T} containing all chains of the given atom container.

Supported keyword arguments

  • molecule_idx::MaybeInt = nothing: Any value other than nothing limits the result to chains belonging to the molecule with the given ID.
source
BiochemicalAlgorithms.parent_chainFunction
parent_chain(::Atom)
parent_chain(::Fragment)
parent_chain(::Nucleotide)
parent_chain(::Residue)

Returns the Chain{T} containing the given object. Returns nothing if no such chain exists.

source
Base.push!Method
push!(::Molecule{T}, ::Chain{T})

Creates a copy of the given chain in the given molecule. The new chain is automatically assigned a new idx.

source

Fragments

BiochemicalAlgorithms.FragmentType
Fragment{T} <: AbstractAtomContainer{T}

Mutable representation of an individual fragment in a system.

Public fields

  • idx::Int
  • number::Int
  • name::String

Private fields

  • properties::Properties
  • flags::Flags
  • molecule_idx::Int
  • chain_idx::Int

Constructors

Fragment(
    chain::Chain{T},
    number::Int;
    # keyword arguments
    name::String = "",
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Fragment{T} in the given chain.

source
BiochemicalAlgorithms.FragmentTableType
FragmentTable{T} <: AbstractSystemComponentTable{T}

Tables.jl-compatible representation of system fragments (or a subset thereof). Fragment tables can be generated using fragments or filtered from other fragment tables (via Base.filter).

Public columns

  • idx::AbstractVector{Int}
  • number::AbstractVector{Int}
  • name::AbstractVector{String}

Private columns

  • properties::AbstractVector{Properties}
  • flags::AbstractVector{Flags}
  • molecule_idx::AbstractVector{Int}
  • chain_idx::AbstractVector{Int}
source
BiochemicalAlgorithms.fragment_by_idxFunction
fragment_by_idx(sys::System{T}, idx::Int64) -> Fragment

Returns the Fragment{T} associated with the given idx in sys. Throws a KeyError if no such fragment exists.

source
BiochemicalAlgorithms.fragmentsFunction
fragments(::Chain)
fragments(::Molecule)
fragments(::System)

Returns a FragmentTable{T} containing all fragments of the given atom container.

Supported keyword arguments

  • molecule_idx::MaybeInt = nothing
  • chain_idx::MaybeInt = nothing

All keyword arguments limit the results to fragments matching the given IDs. Keyword arguments set to nothing are ignored.

source
Base.push!Method
push!(::Chain{T}, ::Fragment{T})

Creates a copy of the given fragment in the given chain. The new fragment is automatically assigned a new idx.

source

Nucleotides

BiochemicalAlgorithms.NucleotideType
Nucleotide{T} <: AbstractAtomContainer{T}

Mutable representation of an individual nucleotide in a system.

Public fields

  • idx::Int
  • number::Int
  • name::String

Private fields

  • properties::Properties
  • flags::Flags
  • molecule_idx::Int
  • chain_idx::Int

Constructors

Nucleotide(
    chain::Chain{T},
    number::Int;
    # keyword arguments
    name::String = "",
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Nucleotide{T} in the given chain.

source
BiochemicalAlgorithms.NucleotideTableType
NucleotideTable{T} <: AbstractSystemComponentTable{T}

Tables.jl-compatible representation of system nucleotides (or a subset thereof). Nucleotide tables can be generated using nucleotides or filtered from other nucleotide tables (via Base.filter).

Public columns

  • idx::AbstractVector{Int}
  • number::AbstractVector{Int}
  • name::AbstractVector{String}

Private columns

  • properties::AbstractVector{Properties}
  • flags::AbstractVector{Flags}
  • molecule_idx::AbstractVector{Int}
  • chain_idx::AbstractVector{Int}
source
BiochemicalAlgorithms.nucleotide_by_idxFunction
nucleotide_by_idx(sys::System{T}, idx::Int64) -> Nucleotide

Returns the Nucleotide{T} associated with the given idx in sys. Throws a KeyError if no such nucleotide exists.

source
BiochemicalAlgorithms.nucleotidesFunction
nucleotides(::Chain)
nucleotides(::Molecule)
nucleotides(::System)

Returns a NucleotideTable{T} containing all nucleotides of the given atom container.

Supported keyword arguments

  • molecule_idx::MaybeInt = nothing
  • chain_idx::MaybeInt = nothing

All keyword arguments limit the results to nucleotides matching the given IDs. Keyword arguments set to nothing are ignored.

source
Base.push!Method
push!(::Chain{T}, ::Nucleotide{T})

Creates a copy of the given nucleotide in the given chain. The new nucleotide is automatically assigned a new idx.

source

Residues

BiochemicalAlgorithms.ResidueType
Residue{T} <: AbstractAtomContainer{T}

Mutable representation of an individual residue in a system.

Public fields

  • idx::Int
  • number::Int
  • type::AminoAcid

Private fields

  • properties::Properties
  • flags::Flags
  • molecule_idx::Int
  • chain_idx::Int

Constructors

Residue(
    chain::Chain{T},
    number::Int,
    type::AminoAcid;
    # keyword arguments
    properties::Properties = Properties(),
    flags::Flags = Flags()
)

Creates a new Residue{T} in the given chain.

source
BiochemicalAlgorithms.ResidueTableType
ResidueTable{T} <: AbstractSystemComponentTable{T}

Tables.jl-compatible representation of system residues (or a subset thereof). Residue tables can be generated using residues or filtered from other residue tables (via Base.filter).

Public columns

  • idx::AbstractVector{Int}
  • number::AbstractVector{Int}
  • type::AbstractVector{AminoAcid}

Private columns

  • properties::AbstractVector{Properties}
  • flags::AbstractVector{Flags}
  • molecule_idx::AbstractVector{Int}
  • chain_idx::AbstractVector{Int}
source
BiochemicalAlgorithms.residue_by_idxFunction
residue_by_idx(sys::System{T}, idx::Int64) -> Residue

Returns the Residue{T} associated with the given idx in sys. Throws a KeyError if no such residue exists.

source
BiochemicalAlgorithms.residuesFunction
residues(::Chain)
residues(::Molecule)
residues(::System)

Returns a ResidueTable{T} containing all residues of the given atom container.

Supported keyword arguments

  • molecule_idx::MaybeInt = nothing
  • chain_idx::MaybeInt = nothing

All keyword arguments limit the results to residues matching the given IDs. Keyword arguments set to nothing are ignored.

source
Base.push!Method
push!(::Chain{T}, ::Residue{T})

Creates a copy of the given residue in the given chain. The new residue is automatically assigned a new idx.

source