System representation
BiochemicalAlgorithms.AbstractAtomContainerBiochemicalAlgorithms.AbstractColumnTableBiochemicalAlgorithms.AbstractSystemComponentBiochemicalAlgorithms.AbstractSystemComponentTableBiochemicalAlgorithms.AtomBiochemicalAlgorithms.AtomTableBiochemicalAlgorithms.BondBiochemicalAlgorithms.BondTableBiochemicalAlgorithms.ChainBiochemicalAlgorithms.ChainTableBiochemicalAlgorithms.FragmentBiochemicalAlgorithms.FragmentTableBiochemicalAlgorithms.MoleculeBiochemicalAlgorithms.MoleculeTableBiochemicalAlgorithms.NucleotideBiochemicalAlgorithms.NucleotideTableBiochemicalAlgorithms.ResidueBiochemicalAlgorithms.ResidueTableBiochemicalAlgorithms.SystemBase.parentBase.push!Base.push!Base.push!Base.push!Base.push!Base.push!Base.push!BiochemicalAlgorithms.atom_by_idxBiochemicalAlgorithms.atom_by_nameBiochemicalAlgorithms.atomsBiochemicalAlgorithms.bond_by_idxBiochemicalAlgorithms.bondsBiochemicalAlgorithms.chain_by_idxBiochemicalAlgorithms.chainsBiochemicalAlgorithms.default_systemBiochemicalAlgorithms.fragment_by_idxBiochemicalAlgorithms.fragmentsBiochemicalAlgorithms.get_propertyBiochemicalAlgorithms.has_flagBiochemicalAlgorithms.has_propertyBiochemicalAlgorithms.is_bound_toBiochemicalAlgorithms.is_geminalBiochemicalAlgorithms.is_vicinalBiochemicalAlgorithms.molecule_by_idxBiochemicalAlgorithms.moleculesBiochemicalAlgorithms.natomsBiochemicalAlgorithms.nbondsBiochemicalAlgorithms.nchainsBiochemicalAlgorithms.nfragmentsBiochemicalAlgorithms.nmoleculesBiochemicalAlgorithms.nnucleotidesBiochemicalAlgorithms.nresiduesBiochemicalAlgorithms.nucleotide_by_idxBiochemicalAlgorithms.nucleotidesBiochemicalAlgorithms.parent_chainBiochemicalAlgorithms.parent_fragmentBiochemicalAlgorithms.parent_moleculeBiochemicalAlgorithms.parent_nucleotideBiochemicalAlgorithms.parent_residueBiochemicalAlgorithms.parent_systemBiochemicalAlgorithms.residue_by_idxBiochemicalAlgorithms.residuesBiochemicalAlgorithms.set_flag!BiochemicalAlgorithms.set_property!BiochemicalAlgorithms.unset_flag!
Abstract types
BiochemicalAlgorithms.AbstractColumnTable — Typeabstract type AbstractColumnTable <: Tables.AbstractColumnsAbstract base type for all Tables.jl-compatible column tables.
BiochemicalAlgorithms.AbstractSystemComponentTable — Typeabstract type AbstractSystemComponentTable{T<:Real} <: AbstractColumnTableAbstract base type for all Tables.jl-compatible system component tables.
BiochemicalAlgorithms.AbstractSystemComponent — Typeabstract type AbstractSystemComponent{T<:Real}Abstract base type for all components of a system, including the system itself.
BiochemicalAlgorithms.AbstractAtomContainer — Typeabstract type AbstractAtomContainer{T} <: AbstractSystemComponent{T}Abstract base type for all atom containers.
Common functions
BiochemicalAlgorithms.has_property — Functionhas_property(
ac::AbstractSystemComponent,
key::Symbol
) -> Any
Returns a Bool indicating whether the given system component has the given property.
BiochemicalAlgorithms.get_property — Functionget_property(
ac::AbstractSystemComponent,
key::Symbol
) -> Any
Returns the property associated with the given key in ac.
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.
BiochemicalAlgorithms.set_property! — Functionset_property!(
ac::AbstractSystemComponent,
key::Symbol,
value
) -> Any
Sets the property associated with the given key in ac to the given value.
BiochemicalAlgorithms.has_flag — Functionhas_flag(ac::AbstractSystemComponent, flag::Symbol) -> Any
Returns a Bool indicating whether the given system component has the given flag.
BiochemicalAlgorithms.set_flag! — Functionset_flag!(ac::AbstractSystemComponent, flag::Symbol) -> Any
Adds the given flag to ac.
BiochemicalAlgorithms.unset_flag! — Functionunset_flag!(
ac::AbstractSystemComponent,
flag::Symbol
) -> Any
Removes the given flag from ac.
Systems
BiochemicalAlgorithms.System — Typemutable struct System{T} <: AbstractAtomContainer{T}Mutable representation of a biomolecular system.
Fields
name::Stringproperties::Propertiesflags::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}.
BiochemicalAlgorithms.default_system — Functiondefault_system() -> System{Float32}
Returns the global default system.
Base.parent — Methodparent(::Atom)
parent(::Bond)
parent(::Chain)
parent(::Fragment)
parent(::Molecule)
parent(::Nucleotide)
parent(::Residue)
parent(::System)Returns the System{T} containing the given object.
BiochemicalAlgorithms.parent_system — Functionparent_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.
Atoms
BiochemicalAlgorithms.Atom — TypeAtom{T} <: AbstractSystemComponent{T}Mutable representation of an individual atom in a system.
Public fields
idx::Intnumber::Intelement::ElementTypename::Stringatom_type::Stringr::Vector3{T}v::Vector3{T}F::Vector3{T}formal_charge::Intcharge::Tradius::T
Private fields
properties::Propertiesflags::Flagsframe_id::Intmolecule_idx::MaybeIntchain_idx::MaybeIntfragment_idx::MaybeIntnucleotide_idx::MaybeIntresidue_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.
BiochemicalAlgorithms.AtomTable — TypeAtomTable{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}
BiochemicalAlgorithms.atom_by_idx — Functionatom_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.
BiochemicalAlgorithms.atom_by_name — Functionatom_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 thannothinglimits the result to atoms matching this frame ID.
BiochemicalAlgorithms.atoms — Functionatoms(::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 = 1molecule_idx::Union{MaybeInt, Some{Nothing}} = nothingchain_idx::Union{MaybeInt, Some{Nothing}} = nothingfragment_idx::Union{MaybeInt, Some{Nothing}} = nothingnucleotide_idx::Union{MaybeInt, Some{Nothing}} = nothingresidue_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.
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.
BiochemicalAlgorithms.is_bound_to — Functionis_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.
BiochemicalAlgorithms.is_geminal — Functionis_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.
BiochemicalAlgorithms.is_vicinal — Functionis_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.
BiochemicalAlgorithms.natoms — Functionnatoms(::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
Base.push! — Methodpush!(::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
Bonds
BiochemicalAlgorithms.Bond — TypeBond{T} <: AbstractAtomContainer{T}Mutable representation of an individual bond in a system.
Public fields
idx::Inta1::Inta2::Intorder::BondOrderType
Private fields
properties::Propertiesflags::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.
BiochemicalAlgorithms.BondTable — TypeBondTable{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}
BiochemicalAlgorithms.bond_by_idx — Functionbond_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.
BiochemicalAlgorithms.bonds — Functionbonds(::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
bonds(::Atom)Returns a BondTable{T} containing all bonds of the given atom.
BiochemicalAlgorithms.nbonds — Functionnbonds(::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
nbonds(::Atom)Returns the number of bonds of the given atom.
Base.push! — Methodpush!(::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.
Molecules
BiochemicalAlgorithms.Molecule — TypeMolecule{T} <: AbstractAtomContainer{T}Mutable representation of an individual molecule in a system.
Public fields
idx::Intname::String
Private fields
properties::Propertiesflags::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.
BiochemicalAlgorithms.MoleculeTable — TypeMoleculeTable{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}
BiochemicalAlgorithms.molecule_by_idx — Functionmolecule_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.
BiochemicalAlgorithms.molecules — Functionmolecules(sys::System{T}) -> MoleculeTable
Returns a MoleculeTable{T} containing all molecules of the given system.
BiochemicalAlgorithms.nmolecules — Functionnmolecules(sys::System) -> Int64
Returns the number of molecules in the given system.
BiochemicalAlgorithms.parent_molecule — Functionparent_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.
Base.push! — Methodpush!(::System{T}, ::Molecule{T})Creates a copy of the given molecule in the given system. The new molecule is automatically assigned a new idx.
Chains
BiochemicalAlgorithms.Chain — TypeChain{T} <: AbstractAtomContainer{T}Mutable representation of an individual chain in a system.
Public fields
idx::Intname::String
Private fields
properties::Propertiesflags::Flagsmolecule_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.
BiochemicalAlgorithms.ChainTable — TypeChainTable{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}
BiochemicalAlgorithms.chain_by_idx — Functionchain_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.
BiochemicalAlgorithms.chains — Functionchains(::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 thannothinglimits the result to chains belonging to the molecule with the given ID.
BiochemicalAlgorithms.nchains — Functionnchains(::Molecule)
nchains(::System; kwargs...)Returns the number of chains in the given atom container.
Supported keyword arguments
See chains
BiochemicalAlgorithms.parent_chain — Functionparent_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.
Base.push! — Methodpush!(::Molecule{T}, ::Chain{T})Creates a copy of the given chain in the given molecule. The new chain is automatically assigned a new idx.
Fragments
BiochemicalAlgorithms.Fragment — TypeFragment{T} <: AbstractAtomContainer{T}Mutable representation of an individual fragment in a system.
Public fields
idx::Intnumber::Intname::String
Private fields
properties::Propertiesflags::Flagsmolecule_idx::Intchain_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.
BiochemicalAlgorithms.FragmentTable — TypeFragmentTable{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}
BiochemicalAlgorithms.fragment_by_idx — Functionfragment_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.
BiochemicalAlgorithms.fragments — Functionfragments(::Chain)
fragments(::Molecule)
fragments(::System)Returns a FragmentTable{T} containing all fragments of the given atom container.
Supported keyword arguments
molecule_idx::MaybeInt = nothingchain_idx::MaybeInt = nothing
All keyword arguments limit the results to fragments matching the given IDs. Keyword arguments set to nothing are ignored.
BiochemicalAlgorithms.nfragments — Functionnfragments(::Chain)
nfragments(::Molecule)
nfragments(::System)Returns the number of fragments in the given atom container.
Supported keyword arguments
See fragments
BiochemicalAlgorithms.parent_fragment — Functionparent_fragment(::Atom)Returns the Fragment{T} containing the given atom. Returns nothing if no such fragment exists.
Base.push! — Methodpush!(::Chain{T}, ::Fragment{T})Creates a copy of the given fragment in the given chain. The new fragment is automatically assigned a new idx.
Nucleotides
BiochemicalAlgorithms.Nucleotide — TypeNucleotide{T} <: AbstractAtomContainer{T}Mutable representation of an individual nucleotide in a system.
Public fields
idx::Intnumber::Intname::String
Private fields
properties::Propertiesflags::Flagsmolecule_idx::Intchain_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.
BiochemicalAlgorithms.NucleotideTable — TypeNucleotideTable{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}
BiochemicalAlgorithms.nnucleotides — Functionnnucleotides(::Chain)
nnucleotides(::Molecule)
nnucleotides(::System)Returns the number of nucleotides in the given atom container.
Supported keyword arguments
See nucleotides
BiochemicalAlgorithms.nucleotide_by_idx — Functionnucleotide_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.
BiochemicalAlgorithms.nucleotides — Functionnucleotides(::Chain)
nucleotides(::Molecule)
nucleotides(::System)Returns a NucleotideTable{T} containing all nucleotides of the given atom container.
Supported keyword arguments
molecule_idx::MaybeInt = nothingchain_idx::MaybeInt = nothing
All keyword arguments limit the results to nucleotides matching the given IDs. Keyword arguments set to nothing are ignored.
BiochemicalAlgorithms.parent_nucleotide — Functionparent_nucleotide(::Atom)Returns the Nucleotide{T} containing the given atom. Returns nothing if no such nucleotide exists.
Base.push! — Methodpush!(::Chain{T}, ::Nucleotide{T})Creates a copy of the given nucleotide in the given chain. The new nucleotide is automatically assigned a new idx.
Residues
BiochemicalAlgorithms.Residue — TypeResidue{T} <: AbstractAtomContainer{T}Mutable representation of an individual residue in a system.
Public fields
idx::Intnumber::Inttype::AminoAcid
Private fields
properties::Propertiesflags::Flagsmolecule_idx::Intchain_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.
BiochemicalAlgorithms.ResidueTable — TypeResidueTable{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}
BiochemicalAlgorithms.nresidues — Functionnresidues(::Chain)
nresidues(::Molecule)
nresidues(::System)Returns the number of residues in the given atom container.
Supported keyword arguments
See residues
BiochemicalAlgorithms.parent_residue — Functionparent_residue(::Atom)Returns the Residue{T} containing the given atom. Returns nothing if no such residue exists.
BiochemicalAlgorithms.residue_by_idx — Functionresidue_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.
BiochemicalAlgorithms.residues — Functionresidues(::Chain)
residues(::Molecule)
residues(::System)Returns a ResidueTable{T} containing all residues of the given atom container.
Supported keyword arguments
molecule_idx::MaybeInt = nothingchain_idx::MaybeInt = nothing
All keyword arguments limit the results to residues matching the given IDs. Keyword arguments set to nothing are ignored.
Base.push! — Methodpush!(::Chain{T}, ::Residue{T})Creates a copy of the given residue in the given chain. The new residue is automatically assigned a new idx.