Learn R Programming

bio3d (version 2.1-2)

dm: Distance Matrix Analysis

Description

Construct a distance matrix for a given protein structure.

Usage

dm(pdb, selection = "calpha", verbose=TRUE)
dm.xyz(xyz, grpby = NULL, scut = NULL, mask.lower = TRUE)

Arguments

pdb
a pdb structure object as returned by read.pdb or a numeric vector of xyz coordinates.
selection
a character string for selecting the pdb atoms to undergo comparison (see atom.select).
verbose
logical, if TRUE possible warnings are printed.
xyz
a numeric vector of Cartesian coordinates.
grpby
a vector counting connective duplicated elements that indicate the elements of xyz that should be considered as a group (e.g. atoms from a particular residue).
scut
a cutoff neighbour value which has the effect of excluding atoms, or groups, that are sequentially within this value.
mask.lower
logical, if TRUE the lower matrix elements (i.e. those below the diagonal) are returned as NA.

Value

  • Returns a numeric matrix of class "dmat", with all N by N distances, where N is the number of selected atoms.

Details

Distance matrices, also called distance plots or distance maps, are an established means of describing and comparing protein conformations (e.g. Phillips, 1970; Holm, 1993).

A distance matrix is a 2D representation of 3D structure that is independent of the coordinate reference frame and, ignoring chirality, contains enough information to reconstruct the 3D Cartesian coordinates (e.g. Havel, 1983).

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

Phillips (1970) Biochem. Soc. Symp. 31, 11--28. Holm (1993) J. Mol. Biol. 233, 123--138. Havel (1983) Bull. Math. Biol. 45, 665--720.

See Also

plot.dmat, read.pdb, atom.select

Examples

Run this code
##--- Distance Matrix Plot
pdb <- read.pdb( "4q21" )
k <- dm(pdb,selection="calpha")
filled.contour(k, nlevels = 10)

## NOTE: FOLLOWING EXAMPLE NEEDS MUSCLE INSTALLED
if(check.utility("muscle")) {

##--- DDM: Difference Distance Matrix
# Downlaod and align two PDB files
pdbs <- pdbaln( get.pdb( c( "4q21", "521p"), path = tempdir() ), outfile = tempfile() )

# Get distance matrix
a <- dm(pdbs$xyz[1,])
b <- dm(pdbs$xyz[2,])

# Calculate DDM
c <- a - b

# Plot DDM
plot(c,key=FALSE, grid=FALSE)

plot(c, axis.tick.space=10,
     resnum.1=pdbs$resno[1,],
     resnum.2=pdbs$resno[2,],
     grid.col="black",
     xlab="Residue No. (4q21)", ylab="Residue No. (521p)")
}

##-- Residue-wise distance matrix based on the
##   minimal distance between all available atoms
l <- dm.xyz(pdb$xyz, grpby=pdb$atom[,"resno"], scut=3)

Run the code above in your browser using DataLab