| dba.plotPCA {DiffBind} | R Documentation |
Principal Component Analysis plot
dba.plotPCA(DBA, attributes, minval, maxval,
contrast, method=DBA$config$AnalysisMethod,
th=DBA$config$th, bUsePval=DBA$config$bUsePval,
report, score, bLog=TRUE, mask, sites, label, cor=FALSE,
b3D=FALSE, vColors, dotSize, labelSize, labelCols,
components=1:3, ...)
DBA |
DBA object. |
attributes |
attribute or vector of attributes to use to color plotted points. Each unique combination of attribute values will be assigned a color. Chosen from: Note that DBA_GROUP is a special attribute which will result in samples from each group in a contrast being colored separately. |
minval |
Set all scores less than this to minval |
maxval |
Set all scores greater than this to maxval |
contrast |
number of contrast to use for PCA; if present, plots a PCA based on a differential binding affinity analysis (see |
method |
method used for analysis (used in conjunction with contrast): |
th |
significance threshold; all sites with FDR (or p-values, see bUsePval) less than or equal to this value will be included in the PCA, subject to maxVal. Used in conjunction with contrast. |
bUsePval |
if TRUE, uses p-value instead of FDR for thresholding. Used in conjunction with contrast. |
report |
report (obtained from |
score |
Score to use for count data. Only used when plotting the global binding matrix (no contrast specified). One of: |
bLog |
Logical indicating that log2 values should be used. Only applicable to read count scores (not peak scores). |
mask |
mask indicating a subset of peaksets to use when using global binding matrix scores. If a contrast is specified, these peaksets will be included, but only the significantly differentially bound sites (using th, bUsePval, and/or report) will be included. See |
sites |
logical vector indicating which sites to include in PCA. Only relevant when using global binding matrix (contrast is missing). |
label |
A metadata field to use as a label in 2D plots. The value for this field will be written directly onthe plot near the dot for each sample. Values can be any of those vlaid for the |
cor |
a logical value indicating whether the calculation should use the correlation matrix or the covariance matrix. Passed into princomp. |
b3D |
logical indicating that three principal components should be plotted (requires package{rgl}). If FALSE, the first two principal components are plotted. |
vColors |
vector of custom colors; is absent, default colors will be used. |
dotSize |
size of dots to plot; is absent, a default will be calculated. |
labelSize |
Scaling factor for labels if present. Default is 0.8. |
labelCols |
Vector of colors to use for labels. Default is "black". |
components |
Number(s) of the components to plot.
Can be a vector of two or three component numbers, or a single integer.
If an integer, that component,
in addition to the succeeding one ( |
... |
arguments passed to plot or plot3d (rgl). |
MODE: PCA plot using significantly differentially bound sites:
dba.plotPCA(DBA, attributes, minval, maxval, contrast, method, th, bUsePval, b3D=F, vColors, dotSize, ...)
MODE: PCA plot using global binding matrix:
dba.plotPCA(DBA, attributes, minval, maxval, mask, sites, b3D=F, vColors, dotSize, ...)
trellis plot from lattice package; see xyplot
uses rgl package for 3D plots (if available)
Rory Stark
data(tamoxifen_peaks)
# peakcaller scores PCA
dba.plotPCA(tamoxifen)
# raw count correlation PCA
data(tamoxifen_analysis)
dba.plotPCA(tamoxifen)
#PCA based on normalized data for all sites
dba.plotPCA(tamoxifen,contrast=1,th=1)
#PCA based on DB sites only
p <- dba.plotPCA(tamoxifen,contrast=1)
p <- dba.plotPCA(tamoxifen,contrast=1,attributes=DBA_TISSUE)
p <- dba.plotPCA(tamoxifen,contrast=1,attributes=DBA_TISSUE,label=DBA_CONDITION)
p <- dba.plotPCA(tamoxifen,contrast=1,attributes=DBA_CONDITION,label=DBA_TISSUE)
p <- dba.plotPCA(tamoxifen,contrast=1,attributes=c(DBA_TISSUE,DBA_CONDITION),
label=DBA_REPLICATE)