Backboner API

Backboner.BackboneType
Backbone{T <: Real, M <: AbstractMatrix{T}} <: AbstractVector{AbstractVector{T}}

The Backbone type is designed to efficiently store and manipulate the three-dimensional coordinates of backbone atoms.

Examples

A Backbone can be created from a matrix of coordinates:

julia> backbone = Backbone(zeros(3, 5)) # 5 atoms with 3 coordinates each
5-element Backbone{Float64}:
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]

julia> backbone[1] = [1.0, 2.0, 3.0]; # set the first atom's coordinates

julia> backbone
5-element Backbone{Float64}:
 [1.0, 2.0, 3.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]

julia> backbone[1:2] # indexing by range returns a `Backbone` wrapped around a view of the original
2-element Backbone{Float64}:
 [1.0, 2.0, 3.0]
 [0.0, 0.0, 0.0]

Arrays will always be flattened to be a 3xN matrix:

julia> backbone = Backbone(zeros(3, 3, 100)) # 3 coordinates per atom, 3 atoms per residue, 100 residues
300-element Backbone{Float64}:
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 ⋮
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
 [0.0, 0.0, 0.0]
Backboner.ChainedBondsType
ChainedBonds{T <: Real}

A lazy way to store a backbone as a series of bond lengths, angles, and dihedrals. It can be instantiated from a Backbone or a matrix of bond vectors. It can also be used to instantiate a Backbone using the Backbone(bonds::ChainedBonds) constructor.

Examples

julia> backbone = readpdb("test/data/1ZAK.pdb")["A"].backbone
660-element Backbone{Float32}:
 [22.346, 17.547, 23.294]
 [22.901, 18.031, 21.993]
 [23.227, 16.793, 21.163]
 [24.115, 16.923, 20.175]
 ⋮
 [22.041, 14.866, 3.569]
 [21.808, 13.861, 2.734]
 [22.263, 13.862, 1.355]
 [21.085, 14.233, 0.446]

julia> bonds = ChainedBonds(backbone)
ChainedBonds{Float32} with 659 bonds, 658 angles, and 657 dihedrals
Backboner.FramesType
Frames{T <: Real} <: AbstractVector{Tuple{QuatRotation{T}, Vector{T}}}

The Frames type is designed to efficiently store and manipulate the rotation and translation of a set of frames.