Determine protein structure network layout in 2D and 3D from the geometric center of each community.

layout.cna(x, pdb, renumber=TRUE, k=2, full=FALSE)

Arguments

x

A protein structure network object as obtained from the ‘cna’ function.

pdb

A pdb class object as obtained from the ‘read.pdb’ function.

renumber

Logical, if TRUE the input ‘pdb’ will be re-numbered starting at residue number one before community coordinate averages are calculated.

k

A single element numeric vector between 1 and 3 specifying the returned coordinate dimensions.

full

Logical, if TRUE the full all-Calpha atom network coordinates will be returned rather than the default clustered network community coordinates.

Details

This function calculates the geometric center for each community from the atomic position of it's Calpha atoms taken from a corresponding PDB file. Care needs to be taken to ensure the PDB residue numbers and the community vector names/length match.

The community residue membership are typically taken from the input network object but can be supplied as a list object with 'x$communities$membership'.

Value

A numeric matrix of Nxk, where N is the number of communities and k the number of dimensions requested.

Author

Guido Scarabelli and Barry Grant

See also

plot.cna, plot.communities, igraph.plotting, plot.igraph

Examples

if (!requireNamespace("igraph", quietly = TRUE)) { message('Need igraph installed to run this example') } else { # Load the correlation network attach(hivp) # Read the starting PDB file to determine atom correspondence pdbfile <- system.file("examples/hivp.pdb", package="bio3d") pdb <- read.pdb(pdbfile) # Plot will be slow #xy <- plot.cna(net) #plot3d.cna(net, pdb) layout.cna(net, pdb, k=3) layout.cna(net, pdb) # can be used as input to plot.cna and plot3d.cna.... # plot.cna( net, layout=layout.cna(net, pdb) ) # plot3d.cna(net, pdb, layout=layout.cna(net, pdb, k=3)) detach(hivp) }