ProteinChains
Documentation for ProteinChains.
ProteinChains.STANDARD_RESIDUE_TEMPLATE
ProteinChains.BackboneGeometry
ProteinChains.IdealResidue
ProteinChains.ProteinChain
ProteinChains.ProteinStructure
ProteinChains.ProteinStructureStore
ProteinChains.ProteinStructureStore
ProteinChains.append_residue
ProteinChains.deserialize
ProteinChains.mapmmcif
ProteinChains.pdbentry
ProteinChains.prepend_residue
ProteinChains.serialize
ProteinChains.STANDARD_RESIDUE_TEMPLATE
— ConstantSTANDARD_RESIDUE_TEMPLATE
This is a template of a "standard residue", with a very specific and distinct shape, size, and orientation. which needs to be consistent if we want to represent protein structures as sets of residue rotations and translations.
Thus, we can use this residue as a template for aligning other residues with very precise geometry to it.
julia> IdealResidue{Float64}(BackboneGeometry(N_Ca_C_angle = 1.93); template=ProteinChains.STANDARD_RESIDUE_TEMPLATE)
3×3 IdealResidue{Float64}:
-1.06447 -0.199174 1.26364
0.646303 -0.529648 -0.116655
0.0 0.0 0.0
ProteinChains.BackboneGeometry
— TypeBackboneGeometry(;
N_Ca_length = 1.46,
Ca_C_length = 1.52,
C_N_length = 1.33,
N_Ca_C_angle = 1.94,
Ca_C_N_angle = 2.03,
C_N_Ca_angle = 2.13,
)
Define the idealized bond lengths and bond angles of a protein backbone.
ProteinChains.IdealResidue
— TypeIdealResidue{T<:AbstractFloat} <: AbstractMatrix{T}
IdealResidue{T}(backbone_geometry=DEFAULT_BACKBONE_GEOMETRY; template=nothing) where T
A 3x3 matrix representing the idealized geometry of a protein residue, with columns representing the N, Ca, and C atom positions of a residue positioned at the origin.
ProteinChains.ProteinChain
— TypeProteinChain{T<:Real}
Represents a protein chain with a basic set of fields from which some other properties might be derived.
ProteinChains.ProteinStructure
— TypeProteinStructure{T} <: AbstractVector{ProteinChain{T}}
Fields
name::String
: Usually just the base name of the original file.chains::Vector{ProteinChain{T}}
: a collection ofProteinChain
s.atoms::Vector{Atom{T}}
: free atoms from the structure that were not part of any protein residue.
ProteinChains.ProteinStructureStore
— TypeProteinStructureStore <: AbstractDict{InlineStrings.String31,ProteinStructure}
A JLD2-based store for protein structures implementing the AbstractDict
interface, allowing for dictionary operations on the stored structures.
Keys are stored as InlineStrings.String31
objects to reduce references. This means keys are limited to 31 bytes.
A ProteinStructureStore
gets closed automatically when there no longer exists a program-accessible reference to it.
Examples
julia> store = ProteinStructureStore("store.pss")
ProteinStructureStore with 0 entries
julia> store["3HFM"] = pdb"3HFM"
[ Info: Downloading file from PDB: 3HFM
3-element ProteinStructure "3HFM.cif":
215-residue ProteinChain{Float64} (H)
214-residue ProteinChain{Float64} (L)
129-residue ProteinChain{Float64} (Y)
julia> store
ProteinStructureStore with 1 entry
julia> keys(store)
Set{InlineStrings.String31} with 1 element:
InlineStrings.String31("3HFM")
julia> delete!(store, "3HFM")
ProteinStructureStore with 0 entries
ProteinChains.ProteinStructureStore
— MethodProteinStructureStore(f::Function, filename, mode="a+")
ProteinChains.append_residue
— Methodappend_residue(Backbone::Backbone, torsion_angles::Vector{<:Real}; ideal::BackboneGeometry=DEFAULT_BACKBONE_GEOMETRY)
Create a new backbone by appending 3 new torsion angles (ψ, ω, ϕ) at the end, using bond lengths and bond angles specified in BackboneGeometry
.
ProteinChains.deserialize
— Methoddeserialize(filename::AbstractString)
Deserialize ProteinStructure
objects from a JLD2 file. Returns a Vector{ProteinStructure}
of all structures stored in the file.
ProteinChains.mapmmcif
— Methodmapmmcif(mmcifdict, field1 => field2, field3 => field4, ...)
julia> import BioStructures
julia> filename = BioStructures.downloadpdb("3HFM", format=BioStructures.MMCIFFormat);
[ Info: Downloading file from PDB: 3HFM
julia> mmcifdict = BioStructures.MMCIFDict(filename);
julia> mapmmcif(mmcifdict,
"_atom_site.auth_asym_id" => "_atom_site.label_entity_id",
"_entity_src_gen.entity_id" => "_entity_src_gen.pdbx_gene_src_ncbi_taxonomy_id")
Dict{String, String} with 3 entries:
"Y" => "9031"
"L" => "10090"
"H" => "10090"
ProteinChains.pdbentry
— Methodpdbentry(pdbid::AbstractString; format=MMCIFFormat, kws...)
Keyword arguments get propagated to BioStructures.downloadpdb
Downloads are cached in a temporary directory.
Examples
julia> pdbentry("1EYE")
[ Info: Downloading file from PDB: 1EYE
1-element ProteinStructure "1EYE.cif":
256-residue ProteinChain{Float64} (A)
julia> pdb"1EYE" # string macro for convenience
[ Info: File exists: 1EYE
1-element ProteinStructure "1EYE.cif":
256-residue ProteinChain{Float64} (A)
julia> pdb"1EYE"A # string suffix to get a specific chain
[ Info: File exists: 1EYE
256-residue ProteinChain{Float64} (A)
julia> pdb"1EYE"1 # integer suffix to specify "ba_number" keyword
[ Info: Downloading file from PDB: 1EYE
2-element ProteinStructure "1EYE_ba1.cif":
256-residue ProteinChain{Float64} (A)
256-residue ProteinChain{Float64} (A-2)
ProteinChains.prepend_residue
— Methodappend_residue(Backbone::Backbone, torsion_angles::Vector{<:Real}; ideal::BackboneGeometry=DEFAULT_BACKBONE_GEOMETRY)
Create a new backbone by prepending 3 new torsion angles (ψ, ω, ϕ) at the beginning, using bond lengths and bond angles specified in the BackboneGeometry
.
ProteinChains.serialize
— Methodserialize(filename::AbstractString, structures::AbstractVector{<:ProteinStructure})
Serialize a vector of ProteinStructure
objects to a JLD2 file. This function creates a new ProteinStructureStore
and writes each structure in the input vector to it. Each structure is stored using its name as the key.