Solvent Accessible Surface Area (SASA)
These functions are used to compute the solvent accessible surface area (SASA) of structures or parts of a structure. They provide a very fast implementation of the Shake-Rupley method, using a Fibonacci lattice to construct the grid points.
PDBTools.sasa_particles — Function
sasa_particles(atoms; probe_radius, n_dots)Calculates the Solvent Accessible Surface Area (SASA) for a vector of Atoms.
Main argument
atoms::Vector{PDBTools.Atom}: A vector of atoms in the molecule.
Returns
PDBTools.SASA structure, containing the vector of atoms, the SASA of each atom (in Ų) and, optionally, the solvent accessible dots that define the surface.
The sasa function computes the total SASA or the SASA of a subset of the atoms in the structure.
Optional arguments
probe_radius::Real=1.4f0: The radius of the solvent probe in Angstroms.n_dots::Int=512: The number of grid points along one axis for dot generation. Higher values lead to more accurate but slower calculations.unitcell=nothing: if periodic boundary conditions are used, provide a 3x3 matrix with the unitcell, or alternatively a vector of length 3 with the sides, for orthorhombic cells.parallel::Bool=true: Control if the computation runs in parallel (requires running Julia with multiple threads).
Example
julia> using PDBTools
julia> prot = select(read_pdb(PDBTools.TESTPDB), "protein");
julia> at_sasa = sasa_particles(prot);
julia> sasa(at_sasa) # total sasa of prot
5389.0146f0
julia> sasa(at_sasa, "backbone") # backbone sasa in prot
988.7648f0
julia> sasa(at_sasa, "not backbone") # other atoms
4400.246f0
julia> sasa(at_sasa, "resname ARG GLU") # some residue types
543.29846f0Additional control:
Two arguments can control the atom radii used for computing the SASA. These arguments are functions:
atom_type: Function that given each atom of the array of atoms, returns the atom "type".atom_radius_from_type: Given the atom "type", returns the vdW radius of the atom.output_dots::Bool=false: If true, the resultingSASAstructure will contain the solvent accessible dots per particle in thedotsfield.
By default, atom_type = PDBTools.element, a function that just returns the element symbol of the atom, and atom_radius_from_type obtains the vdW radius from the PDBTools.elements list given the element symbol. Here, the atomic radii of https://en.wikipedia.org/wiki/Atomicradiioftheelements(datapage) are used. Atoms with missing radius have a NaN value, and the computation will not return meaningful values.
PDBTools.sasa — Function
sasa(s::SASA)
sasa(s::SASA{<:AbstractVector{<:PDBTools.Atom}})
sasa(atoms::SASA{<:AbstractVector{PDBTools.Atom}}, selection::Union{Function,String})Given the output of sasa_particles, sums up contributions of atoms to compute the SASA of the full structure, an atom, or a subset of atoms. The function can be called with only a SASA object (in which case the full SASA is returned), or with the object and a selection, given by a function or selection string.
Example
julia> using PDBTools
julia> prot = select(read_pdb(PDBTools.TESTPDB), "protein");
julia> at_sasa = sasa_particles(prot);
julia> sasa(at_sasa) # total sasa of prot
5389.0146f0
julia> sasa(at_sasa, "backbone") # selection string
988.7648f0
julia> sasa(at_sasa, at -> name(at) == "CA") # selection function
44.078426f0
julia> sasa(at_sasa[1]) # single atom SASA
5.467941f0The sasa_particles function supports periodic boundary conditions if a unit cell is provided. See the how to read the unitcell for further information.
Complete structure SASA
A typical run of these functions consists in providing the structure of a protein to the first function, sasa_particles, to obtain a SASA object, which contains the accessible area per atom:
using PDBTools
prot = read_pdb(PDBTools.TESTPDB, "protein")
atom_sasa = sasa_particles(prot)PDBTools.SASA{3, Vector{Atom{Nothing}}}
Number of particles: 1463
Total SASA: 5363.555
Output of dots: false The output provides the SASA of the complete structure, but the atoms_sasa object created contains the SASA of each atom, from which the accessible area of subsets can be retrieved.
SASA of structure subsets
The atom_sasa object created above can be used to extract the total accessible area or the accessible area of any sub-surface. The sasa function provides an interface for those extractions:
sasa(atom_sasa) # total5363.555f0sasa(atom_sasa, "polar")4687.9873f0sasa(atom_sasa, "backbone")977.308f0sasa(atom_sasa, "resname THR and residue < 50")174.11f0Visualization of the surface
In some situations, it might be useful to visualize the surface. The dots that form the surface can be obtained by running sasa_particles with the output_dots option set to true. Here, we use fewer dots for better visualization:
atom_sasa = sasa_particles(prot; n_dots=100, output_dots=true)PDBTools.SASA{3, Vector{Atom{Nothing}}}
Number of particles: 1463
Total SASA: 5342.6265
Output of dots: true Where the atom_sasa.dots field contains the dots that are accessible to the surface for each atom. These can be plotted, for example, with:
using Plots
dots = reduce(vcat, atom_sasa.dots)
scatter(Tuple.(positions(prot)); color=:orange, msw=0, label="") # atom coordinates
scatter!(Tuple.(dots); # surface dots
color=:blue, ms=1, msw=0, ma=0.5, # marker properties
label="",
)SIRAH solvent accessible area
To compute the solvent accessible surface area of SIRAH models, call the sasa_particles(SIRAH, ...) method, after loading the custom protein residues and elements of the SIRAH force field:
using PDBTools
custom_protein_residues!(SIRAH)
custom_elements!(SIRAH)
sirah_pdb = read_pdb(PDBTools.SIRAHPDB) Vector{Atom{Nothing}} with 22 atoms with fields:
index name resname chain resnum residue x y z occup beta model segname index_pdb
1 GN sI A 1 1 161.582 517.490 112.440 0.00 0.00 1 A 1
2 GC sI A 1 1 160.232 516.820 112.280 0.00 0.00 1 A 2
⋮
21 GC sG A 5 5 156.642 505.730 109.530 0.00 0.00 1 A 21
22 GO sG A 5 5 156.002 505.070 111.770 0.00 0.00 1 A 22Now we compute the SASA of the full structure:
s_sirah = sasa_particles(SIRAH, sirah_pdb)PDBTools.SASA{3, Vector{Atom{Nothing}}}
Number of particles: 22
Total SASA: 1535.7573
Output of dots: false And the SASA of subsets of the structure can also be obtained:
sasa(s_sirah, "sidechain")812.94617f0Here we remove the custom elements and residues, to guarantee proper execution of test codes:
remove_custom_protein_residues!()
remove_custom_elements!()Dict{String, PDBTools.Element} with 267 entries:
"Pd" => Element(:Pd, String15("Pd"), "Palladium", 46, 106.4, false, 1.63)
"Ag" => Element(:Ag, String15("Ag"), "Silver", 47, 107.868, false, 1.72)
"Gd" => Element(:Gd, String15("Gd"), "Gadolinium", 64, 157.25, false, NaN)
"Actinium" => Element(:Ac, String15("Ac"), "Actinium", 89, 227.028, false, NaN)
"Europium" => Element(:Eu, String15("Eu"), "Europium", 63, 151.96, false, NaN)
⋮ => ⋮