This Julia package provides implements the ProteinChain
type: a chain-level structure-of-arrays type representation of proteins, with support for indexing by residue index.
using Pkg
Pkg.add("ProteinChains")
The ProteinChain
type is meant to only store a basic set of fields, from which some other properties might be derived.
julia> using ProteinChains
julia> structure = pdb"1EYE" # string macro to fetch proteins from the PDB
[ Info: File exists: 1EYE
1-chain ProteinStructure{Float64} "1EYE.cif"
256-residue ProteinChain{Float64} (A)
julia> chain = structure["A"]
256-residue ProteinChain{Float64} (A)
julia> propertynames(chain)
(:id, :atoms, :sequence, :ins_codes, :numbering)
To store additional properties, addpropertie!s
can be used to attach persistent chain-level properties or indexable residue-level properties:
julia> addproperties!(chain; taxid=83332)
256-residue ProteinChain{Float64} (A)
julia> addproperties!(chain; rand3=IndexableProperty(rand(3,256))) # last dimension matches chain length
256-residue ProteinChain{Float64} (A)
julia> chain[1:100].rand3
3×100 Matrix{Float64}:
0.273545 0.639173 0.92708 … 0.459441 0.196407 0.880034
0.981498 0.70263 0.279264 0.552049 0.89274 0.0328866
0.169268 0.117848 0.732741 0.301921 0.187094 0.281187
julia> propertynames(chain)
(:id, :atoms, :sequence, :ins_codes, :numbering, :rand3, :taxid)