network.amendment: Amendment of a CNA Network According To A Input Community...

View source: R/network.amendment.R

network.amendmentR Documentation

Amendment of a CNA Network According To A Input Community Membership Vector.

Description

This function changes the ‘communities’ attribute of a ‘cna’ class object to match a given membership vector.

Usage

  network.amendment(x, membership, minus.log=TRUE)

Arguments

x

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

membership

A numeric vector containing the new community membership.

minus.log

Logical. Whether to use the minus.log on the cij values.

Details

This function is useful, in combination with ‘community.tree’, for inspecting different community partitioning options of a input ‘cna’ object. See examples.

Value

Returns a ‘cna’ class object with the attributes changed according to the membership vector provided.

Author(s)

Guido Scarabelli

See Also

cna, community.tree, summary.cna

Examples


# PDB server connection required - testing excluded

if (!requireNamespace("igraph", quietly = TRUE)) {
   message('Need igraph installed to run this example')
} else {

try({

##-- Build a CNA object
pdb <- read.pdb("4Q21")
modes <- nma(pdb)
cij <- dccm(modes)
net <- cna(cij, cutoff.cij=0.2)

##-- Community membership vector for each clustering step
tree <- community.tree(net, rescale=TRUE)

## Produce a new k=7 membership vector and CNA network
memb.k7 <- tree$tree[ tree$num.of.comms == 7, ]
net.7 <- network.amendment(net, memb.k7)

plot(net.7, pdb)

print(net)
print(net.7)

}, silent=TRUE)
if(inherits(.Last.value, "try-error")) {
   message("Need internet to run the example")
}
}


bio3d documentation built on Oct. 30, 2024, 1:08 a.m.