Align communities from two or more networks

Usage

community.aln(x, ...)

Arguments

x, ...
two or more objects of class cna (with equal number of nodes) as obtained from function cna. Alternatively, a list of cna objects can be given to x, the element of which will be used for pairwise comparison.

Value

Returns a list of updated cna objects.

Description

Find equivalent communities from two or more networks and renumber them in a consistent way across networks.

Details

This function facilitates the inspection on the variance of the community partition in a group of similar networks. The original community numbering (and so coloring in plot.cna) can be inconsistent across networks, i.e. equivalent communities may have different numbering in different networks. The function calculates the dissimilarity between all communities and clusters communities with ‘hclust’ funciton. In each cluster, 0 or 1 community per network is included. Communities are then renumbered according to the clusters through all networks. Note that the ‘membership’ in $communities is not updated because some basic ‘igraph’ functions such as length assume the ‘membership’ a consecutive integer vector. Instead, a ‘renumbered’ membership vector is added as an extra component in the returned ‘cna’ object.

Examples

# Needs MUSCLE installed - testing excluded ## Fetch PDB files and split to chain A only PDB files ids <- c("1tnd_A", "1tag_A") files <- get.pdb(ids, split = TRUE, path = tempdir())
|======================================================================| 100%
## Sequence Alignement pdbs <- pdbaln(files, outfile = tempfile())
Reading PDB files: /tmp/RtmpTDihxb/split_chain/1tnd_A.pdb /tmp/RtmpTDihxb/split_chain/1tag_A.pdb .. Extracting sequences pdb/seq: 1 name: /tmp/RtmpTDihxb/split_chain/1tnd_A.pdb pdb/seq: 2 name: /tmp/RtmpTDihxb/split_chain/1tag_A.pdb
## Normal mode analysis on aligned data modes <- nma(pdbs, rm.gaps=TRUE)
Details of Scheduled Calculation: ... 2 input structures ... storing 936 eigenvectors for each structure ... dimension of x$U.subspace: ( 942x936x2 ) ... coordinate superposition prior to NM calculation ... aligned eigenvectors (gap containing positions removed) ... estimated memory usage of final 'eNMA' object: 13.5 Mb |======================================================================| 100%
## Dynamic Cross Correlation Matrix cijs <- dccm(modes)$all.dccm ## Correlation Network nets <- cna(cijs, cutoff.cij=0.3) ## Align network communities nets.aln <- community.aln(nets) ## plot all-residue and coarse-grained (community) networks pdb <- pdbs2pdb(pdbs, inds=1, rm.gaps=TRUE)[[1]] op <- par(no.readonly=TRUE) # before alignment par(mar=c(0.1, 0.1, 0.1, 0.1), mfrow=c(2,2)) invisible( lapply(nets, function(x) plot(x, layout=layout.cna(x, pdb=pdb, k=3, full=TRUE)[, 1:2], full=TRUE)) ) invisible( lapply(nets, function(x) plot(x, layout=layout.cna(x, pdb=pdb, k=3)[, 1:2])) )

# after alignment par(mar=c(0.1, 0.1, 0.1, 0.1), mfrow=c(2,2)) invisible( lapply(nets.aln, function(x) plot(x, layout=layout.cna(x, pdb=pdb, k=3, full=TRUE)[, 1:2], full=TRUE)) ) invisible( lapply(nets.aln, function(x) plot(x, layout=layout.cna(x, pdb=pdb, k=3)[, 1:2])) )

par(op)

See also

cna, plot.cna