network.amendment(x, membership, minus.log=TRUE)
This function changes the communities attribute of a cna class object to match a given membership vector.
This function is useful, in combination with community.tree, for inspecting different community partitioning options of a input cna object. See examples.
# PDB server connection required - testing excluded ##-- Build a CNA object pdb <- read.pdb("4Q21")Note: Accessing on-line PDB filemodes <- nma(pdb)Building Hessian... Done in 0.067 seconds. Diagonalizing Hessian... Done in 0.277 seconds.cij <- dccm(modes)|======================================================================| 100%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)Obtaining layout from PDB structureprint(net)Call: cna.dccm(cij = cij, cutoff.cij = 0.2) Structure: - NETWORK NODES#: 168 EDGES#: 668 - COMMUNITY NODES#: 9 EDGES#: 19 + attr: network, communities, community.network, community.cij, cij, callprint(net.7)Call: cna.dccm(cij = cij, cutoff.cij = 0.2) Structure: - NETWORK NODES#: 168 EDGES#: 668 - COMMUNITY NODES#: 7 EDGES#: 13 + attr: network, communities, community.network, community.cij, cij, call