bgaPlotly3d | R Documentation |
Create an interactive 3-D BGA plotly visualization
bgaPlotly3d(
bgaInfo,
axes = c(1, 2, 3),
superGroups = NULL,
superGroupAlpha = 0.3,
superGroupLwd = 25,
arrowSmoothFactor = 8,
colorSub = NULL,
drawVectors = c("none", "centroids", "genes"),
highlightGenes = NULL,
drawSampleLabels = TRUE,
ellipseType = c("ellipsoid", "alphahull", "none"),
ellipseOpacity = 0.2,
useScaledCoords = FALSE,
geneColor = "#555555",
geneScaleFactor = 1,
geneLwd = 2,
geneAlpha = 0.7,
geneLabels = NULL,
maxGenes = 50,
centroidLwd = 15,
centroidAlpha = 0.3,
textposition_centroid = "top center",
textposition_sample = "middle right",
sceneX = -1.25,
sceneY = 1.25,
sceneZ = 1.25,
main = "",
plot_bgcolor = "#eeeeee",
paper_bgcolor = "#dddddd",
sampleGroups = NULL,
debug = FALSE,
verbose = TRUE,
...
)
bgaInfo |
object of class |
axes |
|
superGroups |
|
superGroupAlpha |
|
superGroupLwd |
|
arrowSmoothFactor |
|
colorSub |
|
drawVectors |
|
drawSampleLabels |
|
ellipseType |
|
ellipseOpacity |
|
useScaledCoords |
|
geneColor |
|
geneScaleFactor |
|
geneLwd , geneAlpha |
|
geneLabels |
|
maxGenes |
|
centroidLwd , centroidAlpha |
|
textposition_centroid , textposition_sample |
|
sceneX , sceneY , sceneZ |
|
main |
|
sampleGroups |
|
verbose |
|
... |
additional parameters are ignored |
This function takes the output from made4::bga()
(class "bga"
)
and creates a 3D plotly visualization which shows the samples,
sample centroids, and optionally a subset of genes in the same
BGA component space.
For general guidance, when the data contains four or more sample
groups, this function can be called to produce a 3-D plot.
BGA itself produces n-1
dimensions, therefore when there are
fewer than four groups, a 3-D plot cannot be produced.
When analyzing data with fewer than four groups, it is sometimes
helpful to cluster samples individually. This approach is roughly
equivalent to performing PCA or COA directly, but is sometimes
convenient in being consistent with calling made4::bga()
, as
it also applies the same scaling method used in made4:bga()
prior to calling PCA or COA. In that case, the groups can still
be displayed by bgaPlotly3d()
by defining the sampleGroups
argument. The result will display typical PCA or COA coordinates,
but visually displays the centroid of each sample group.
This function is especially useful when there are multiple
sample groups that belong to a "supergroup" – a higher level
of grouping. Consider an experiment with two cell lines treated
over multiple time points. The samples would be assigned to
a group based upon cell_line and time, then each group would
be assigned to a supergroup based upon cell_line. The output
plot will display each sample group, group centroid, then
connect group centroids in order by the supergroup.
The order of groups within each supergroup is determined
either by factor levels, or by the order returned by
jamba::mixedSort()
which performs a proper alphanumeric sort.
bga
object contentOutput from made4::bga()
is an object with class
containing "bga"
.
It is a list with three elements:
"ord"
: ordination, the initial clustering results from either "coa"
(default) or "pca"
clustering across all individual samples. This data
is fed into the second phase, group-based clustering.
"bet"
: the between group analysis result, derived from "ord"
.
"fac"
: factor
vector of groups across the colnames(x)
of
input data.
The "bet"
contents are described below, assuming the results of
made::bga()
are stored as bgaInfo
:
gene (row) coordinates are stored:
bgaInfo$bet$co
: unscaled coordinates for each component axis
bgaInfo$bet$c1
: scaled coordinates for each component axis
group centroid coordinates are stored:
bgaInfo$bet$li
: unscaled group centroid coordinates
bgaInfo$bet$ls
: scaled group centroid coordinates
sample centroid coordinates are stored:
bgaInfo$bet$ls
: scaled coordinates for each component axis
plotly object sufficient to render an HTML page containing a 3-D BGA plot.
Other jam plot functions:
factor2label()
,
gene2gg()
,
grl2df()
,
jitter_norm()
,
plotSashimi()
,
prepareSashimi()
,
stackJunctions()
Other jam spatial functions:
compressPolygonM()
,
dfWide2segments()
,
simplifyXY()
,
spline3d()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.