Learn R Programming

bio3d (version 2.2-4)

plot.fluct: Plot Fluctuations

Description

Produces a plot of atomic fluctuations obtained from ensemble normal mode analysis or molecular dynamics simulations.

Usage

"plot"(x, col = NULL, signif = FALSE, p.cutoff = 0.005, q.cutoff = 0.04, s.cutoff = 5, n.cutoff = 2, mean = FALSE, polygon = FALSE, ncore = NULL, ...)

Arguments

x
a numeric vector or matrix containing atomic fluctuation data obtained from e.g. nma.pdbs or rmsf.
col
a character vector of plotting colors. Used also to group fluctuation profiles. NA values in col will omit the corresponding fluctuation profile in the plot.
signif
logical, if TRUE significance of fluctuation difference is calculated and annotated for each atomic position.
p.cutoff
Cutoff of p-value to define significance.
q.cutoff
Cutoff of the mean fluctuation difference to define significance.
s.cutoff
Cutoff of sample size in each group to calculate the significance.
n.cutoff
Cutoff of consecutive residue positions with significant fluctuation difference. If the actual number is less than the cutoff, correponding postions will not be annotated.
mean
logical, if TRUE plot mean fluctuations of each group. Significance is still calculated with the original data.
polygon
logical, if TRUE a nicer plot with area under the line for the first row of x are filled with polygons.
ncore
number of CPU cores used to do the calculation. By default (ncore=NULL), use all available CPU cores. The argument is only used when signif=TRUE.
...
extra plotting arguments passed to plot.bio3d.

Value

If significance is calculated, return a vector indicating significant positions.

Details

The significance calculation is performed when signif=TRUE and there are at least two groups with sample size larger than or equal to s.cutoff. A "two-sided" student's t-test is performed for each atomic position (each column of x). If x contains gaps, indicated by NAs, only non-gapped positions are considered. The position is considered significant if both p-value <= p.cutoff<="" code=""> and the mean value difference of the two groups, q, satisfies q >= q.cutoff. If more than two groups are available, every pair of groups are subjected to the t-test calculation and the minimal p-value along with the q-value for the corresponding pair are used for the significance evaluation.

References

Grant, B.J. et al. (2006) Bioinformatics 22, 2695--2696.

See Also

plot.bio3d, rmsf, nma.pdbs, t.test, polygon.

Examples

Run this code
## Not run: 
# ## load transducin example data
# attach(transducin)
# 
# ## remove flexible termina for a full-length NMA calculation
# inds = 30:(ncol(pdbs$ali)-8)
# npdbs = trim(pdbs, col.inds = inds)
# gaps.res = gap.inspect(npdbs$ali)
# 
# ## reference PDB for secondary structure annotation
# ref.pdb_id = substr(npdbs$id[1], 1, 4)
# ref.chain_id = substr(npdbs$id[1], 6, 6)
# ref.resno = npdbs$resno[1, !is.na(npdbs$resno[1, ])]
# pdb = read.pdb(ref.pdb_id)
# pdb = trim(pdb, resno=ref.resno, chain=ref.chain_id)
# 
# ## eNMA calculation and obtain modes of motion including atomic fluctuations
# modes <- nma(npdbs, rm.gaps=FALSE, full=FALSE, ncore=NULL)
# x = modes$fluctuation
# 
# ## simple line plot with SSE annotation
# plot.fluct(x, sse = pdb, resno = pdb)
# 
# ## group data by specifying colors of each fluctuation line; same color indicates
# ## same group. Also do significance calculation and annotation
# col = annotation[, "color"]
# col[annotation[, "state3"] == "GDI"] = "blue"
# plot.fluct(x, col=col, signif = TRUE, sse = pdb, resno = pdb)
# 
# ## show only line of mean values for each group. Gapped positions are removed. Nicer  
# ## plot with area shaded for the first group.
# plot.fluct(x, col=col, signif = TRUE, sse = pdb, resno = pdb, mean=TRUE, polygon=TRUE, rm.gaps=TRUE)
# 
# detach(transducin)
# ## End(Not run)

Run the code above in your browser using DataLab