Learn R Programming

bio3d (version 2.2-4)

cnapath: Suboptimal Path Analysis for Correlation Networks

Description

Find k shortest paths between a pair of nodes, source and sink, in a correlation network.

Usage

cnapath(cna, from, to, k = 10, ncore = NULL, ...) "summary"(object, ..., pdb = NULL, label = NULL, col = NULL, plot = FALSE, concise = FALSE, cutoff = 0.1, normalize = TRUE) "print"(x, ...) view.cnapath(x, pdb, out.prefix = "view.cnapath", spline = FALSE, colors = c("blue", "red"), launch = FALSE, ...)

Arguments

cna
A ‘cna’ object obtained from cna.
from
Integer, node id for the source.
to
Integer, node id for the sink.
k
Integer, number of suboptimal paths to identify.
ncore
Number of CPU cores used to do the calculation. By default (NULL), use all detected CPU cores.
...
Additional arguments passed to igraph function get.shortest.paths (in the function cnapath), passed to summary.cnapath (in print.cnapath), as additional paths for comparison (in summary.cnapath), or passed to the function colorRamp (in view.cnapath).
object
A ‘cnapath’ class of object obtained from cnapath. Multiple ‘pa’ input is allowed for comparative statistical analysis in summary.cnapath.
pdb
A ‘pdb’ class of object obtained from read.pdb and is used as the reference for node residue ids or for molecular visulaization in VMD.
label
Character, labels for paths identified from different networks.
col
colors for plotting statistical resutls for paths identified from different networks.
plot
logical, if TRUE path length distribution and node degeneracy will be plotted.
concise
logical, if TRUE only ‘on path’ residues will be displayed.
cutoff
numeric, degeneracy cutoff for displaying nodes on paths.
normalize
logical, if TRUE node degeneracy is defined by the percentage of total number of paths.
x
A ‘cnapath’ class of object obtained from cnapath.
out.prefix
prefix for the names of output files, ‘view.vmd’ and ‘view.pdb’.
spline
logical, if TRUE all paths are displayed as spline curves.
colors
character vector or integer scalar, define path colors. If a character vector, passed to colorRamp function to generate the color scales. If an integer, color all paths the same way with VMD color ID equal to the integer.
launch
logical, if TRUE VMD will be launched.

Value

The function cnapath returns a ‘cnapath’ class of list containing following three components:
path
a list object containing all identified suboptimal paths. Each entry of the list is a sequence of node ids for the path.
epath
a list object containing all identified suboptimal paths. Each entry of the list is a sequence of edge ids for the path.
dist
a numeric vector of all path lengths.
The function summary.cnapath with return a matrix of (normalized) node degeneracy for ‘on path’ residues.

References

Yen, J.Y. (1971) Management Science 17, 712--716.

See Also

cna, cna.dccm, get.shortest.paths.

Examples

Run this code

# Redundant testing excluded

attach(transducin)
inds = match(c("1TND_A", "1TAG_A"), pdbs$id)

npdbs <- trim(pdbs, row.inds=inds)
gaps.res <- gap.inspect(npdbs$ali)

modes <- nma(npdbs)
cij <- dccm(modes)
net <- cna(cij, cutoff.cij=0.3)

# get paths
pa1 <- cnapath(net[[1]], from = 314, to=172, k=50)
pa2 <- cnapath(net[[2]], from = 314, to=172, k=50)

# print the information of a path
pa1

# print two paths simultaneously
pas <- list(pa1, pa2)
names(pas) <- c("GTP", "GDP")
print.cnapath(pas)

# Or, for the same effect,
# summary(pa1, pa2, label=c("GTP", "GDP"))

# replace node numbers with residue name and residue number in the PDB file
pdb <- read.pdb("1tnd")
pdb <- trim.pdb(pdb, atom.select(pdb, chain="A", resno=npdbs$resno[1, gaps.res$f.inds]))
print.cnapath(pas, pdb=pdb)

# plot path length distribution and node degeneracy
print.cnapath(pas, pdb = pdb, col=c("red", "darkgreen"), plot=TRUE)

# View paths in 3D molecular graphic with VMD
#view.cnapath(pa1, pdb, launch = TRUE)
#view.cnapath(pa1, pdb, colors = 7, launch = TRUE)
#view.cnapath(pa1, pdb, spline=TRUE, colors=c("pink", "red"), launch = TRUE)
#pdb2 <- read.pdb("1tag")
#pdb2 <- trim.pdb(pdb2, atom.select(pdb2, chain="A", resno=npdbs$resno[2, gaps.res$f.inds]))
#view.cnapath(pa2, pdb2, launch = TRUE)

detach(transducin)

Run the code above in your browser using DataLab