filter.cmap(cm, cutoff.sims = NULL)
cmap
. Here, N is the residue number and Z
the simulation number. The matrix elements should be 1 if two
residues are in contact and 0 if they are not in contact. This function filters a tridimensional contact matrix (NxNxZ), where N is the residue number and Z is the simulation number) selecting only contacts present in at least P simulations.
## load example data pdbfile <- system.file("examples/hivp.pdb", package="bio3d") pdb <- read.pdb(pdbfile) trtfile <- system.file("examples/hivp.dcd", package="bio3d") trj <- read.dcd(trtfile, verbose=FALSE) ## split the trj example in two num.of.frames <- dim(trj)[1] trj1 <- trj[1:(num.of.frames/2),] trj2 <- trj[((num.of.frames/2)+1):num.of.frames,] ## Lets work with Calpha atoms only ca.inds <- atom.select(pdb, "calpha") #noh.inds <- atom.select(pdb, "noh") ## calculate single contact map matrices cms <- list() cms[[1]] <- cmap(trj1[,ca.inds$xyz], pcut=0.3, scut=0, dcut=7, mask.lower=FALSE)|======================================================================| 100%cms[[2]] <- cmap(trj1[,ca.inds$xyz], pcut=0.3, scut=0, dcut=7, mask.lower=FALSE)|======================================================================| 100%## calculate average contact matrix cm.filter <- filter.cmap(cms, cutoff.sims=2) ## plot the result par(pty="s", mfcol=c(1,3)) plot.cmap(cms[[1]]) plot.cmap(cms[[2]]) plot.cmap(cm.filter)