Protein API

These following functions need to be imported explicitly with using Backboner.Protein

Backboner.Protein.ChainType
Chain <: AbstractVector{Residue}

A Chain represents a chain of a protein, and is a vector of Residues, which are instantiated from indexing the chain.

Fields

  • id::String: A string identifier (usually a single letter).
  • backbone::Backbone: A backbone with a length divisible by 3, to ensure 3 atoms per residue (N, Ca, C).
  • modelnum::Int: The model number of the chain.
  • resnums::Vector{Int}: storing the residue numbers.
  • aavector::Vector{Char}: storing the amino acid sequence.
  • ssvector::Vector{Char}: storing the secondary structure.
Backboner.Protein.alphacarbon_anglesMethod
alphacarbon_angles(chain::Chain)
alphacarbon_angles(bonds::ChainedBonds)

Calculate the angles at the alphacarbon atoms (N-Ca-C angles) of a chains backbone, or take directly from a precalculated ChainedBonds instance.

Backboner.Protein.alphacarbon_carbonyl_distancesMethod
alphacarbon_carbonyl_distances(chain::Chain)
alphacarbon_carbonyl_distances(backbone::Backbone)
alphacarbon_carbonyl_distances(bonds::ChainedBonds)

Calculate the distances between all pairs of contiguous alpha-carbon and carbonyl atoms in a chain. Returns a vector of distances of length length(chain).

Backboner.Protein.alphacarbon_coordsMethod
alphacarbon_coords(chain::Chain)
alphacarbon_coords(backbone::Backbone)

Returns the coordinates of all alphacarbon atoms in a chain, as a 3xN matrix.

Backboner.Protein.carbonyl_anglesMethod
carbonyl_angles(chain::Chain)
carbonyl_angles(bonds::ChainedBonds)

Calculate the angles at the carbonyl atoms (Ca-C-N angles) of a chain's backbone, or take directly from a precalculated ChainedBonds instance.

Backboner.Protein.carbonyl_coordsMethod
carbonyl_coords(chain::Chain)
carbonyl_coords(backbone::Backbone)

Returns the coordinates of all carbonyl atoms in a chain, as a 3xN matrix.

Backboner.Protein.carbonyl_nitrogen_distancesMethod
carbonyl_nitrogen_distances(chain::Chain)
carbonyl_nitrogen_distances(backbone::Backbone)
carbonyl_nitrogen_distances(bonds::ChainedBonds)

Calculate the distances between all pairs of contiguous carbonyl and nitrogen atoms in a chain. Returns a vector of distances of length length(chain) - 1.

Backboner.Protein.nitrogen_alphacarbon_distancesMethod
nitrogen_alphacarbon_distances(chain::Chain)
nitrogen_alphacarbon_distances(backbone::Backbone)
nitrogen_alphacarbon_distances(bonds::ChainedBonds)

Calculate the distances between all pairs of contiguous nitrogen and alpha-carbon atoms in a chain. Returns a vector of distances of length length(chain).

Backboner.Protein.nitrogen_anglesMethod
nitrogen_angles(chain::Chain)
nitrogen_angles(backbone::Backbone)
nitrogen_angles(bonds::ChainedBonds)

Calculate the angles at the nitrogen atoms (C-N-Ca angles) of a chains backbone, or take directly from a precalculated ChainedBonds instance.

Backboner.Protein.nitrogen_coordsMethod
nitrogen_coords(chain::Chain)
nitrogen_coords(backbone::Backbone)

Returns the coordinates of all nitrogen atoms in a chain, as a 3xN matrix.

Backboner.Protein.omega_anglesMethod
omega_angles(chain::Chain)
omega_angles(backbone::Backbone)
omega_angles(bonds::ChainedBonds)

Calculate the omega (Ω) angles of a chain's backbone, or take directly from a precalculated ChainedBonds instance.

Backboner.Protein.oxygen_coordsMethod
oxygen_coords(chain::Chain)

Add oxygen atoms to the backbone of a protein, turning the coordinate array from size 3x3xL to 3x4xL-1, where L is the length of the backbone.

Example

julia> chains = readpdb("test/data/1ZAK.pdb")
2-element Vector{Chain}:
 Chain A with 220 residues
 Chain B with 220 residues

julia> oxygen_coords(chains["A"]) # returns the estimated position of oxygen atoms in chain A (~0.05 Å mean deviation)
3×220 Matrix{Float64}:
 22.6697  25.1719  24.7761  25.8559  …  24.7911   22.7649   22.6578   21.24
 15.7257  13.505   13.5151  11.478      15.0888   12.2361   15.8825   14.2933
 21.4295  19.5663  22.8638  25.3283      7.95346   4.81901   3.24164  -0.742424        
Note

The oxygen_coords function finds the oxygen atoms to the backbone using idealized geometry, and oxygens atom will on average deviate 0.05 Å from original PDB positions. Moreover, the last oxygen atom is essentially given a random (although deterministic) orientation, as that information is lost when the backbone is reduced to 3 atoms, and there's no next nitrogen atom to compare with.

Backboner.Protein.phi_anglesMethod
phi_angles(chain::Chain)
phi_angles(backbone::Backbone)
phi_angles(bonds::ChainedBonds)

Calculate the phi (φ) angles of a chain's backbone, or take directly from a precalculated ChainedBonds instance.

Backboner.Protein.psi_anglesMethod
psi_angles(chain::Chain)
psi_angles(backbone::Backbone)
psi_angles(bonds::ChainedBonds)

Calculate the psi (ψ) angles of a chain's backbone, or take directly from a precalculated ChainedBonds instance.

Backboner.Protein.readchainsMethod
readchains(path, format) -> chains::Vector{Protein.Chain}

Loads a protein structure from a PDB file.

Exported formats: PDBFormat, MMCIFFormat

Examples

julia> readchains("example.pdb") # detects PDB format from extension

julia> readchains("example.cif") # detects mmCIF format from extension

julia> readchains("example.abc", PDBFormat) # force PDB format

julia> readchains("example.xyz", MMCIFFormat) # force mmCIF format
Backboner.Protein.writechainsMethod
writechains(path, chains::AbstractVector{Protein.Chain}, format)
writechains(path, chain::Protein.Chain, format)

Write a protein structure (represented as a Vector{Protein.Chain}s) to file with the specified format.

Exported formats: PDBFormat, MMCIFFormat

Examples

julia> writechains("example.pdb", chains) # detects PDB format from extension

julia> writechains("example.cif", chains) # detects mmCIF format from extension

julia> writechains("example.abc", chains, PDBFormat) # force PDB format

julia> writechains("example.xyz", chains, MMCIFFormat) # force mmCIF format