ScpModel-VarianceAnalysis | R Documentation |
Analysis of variance investigates the contribution of each effects in capturing the variance in the data.
scpVarianceAnalysis(object, name)
scpVarianceAggregate(varianceList, fcol)
scpVariancePlot(
varianceList,
effect = "Residuals",
by = "percentExplainedVar",
top = Inf,
decreasing = TRUE,
combined = TRUE,
fcol = NULL,
colourSeed = 1234
)
object |
An object that inherits from the
|
name |
A |
varianceList |
A list of tables returned by
|
fcol |
A |
effect |
A |
by |
A |
top |
A |
decreasing |
A |
combined |
A |
colourSeed |
A |
scpVarianceAnalysis()
computes the amount of data (measured as
the sums of squares) that is captured by each model variable, but
also that is not modelled and hence captured in the residuals. The
proportion of variance explained by each effect is the sums of
squares for that effect divided by the sum of all sums of squares
for each effect and residuals. This is computed for each feature
separately. The function returns a list of DataFrame
s with one
table for each effect.
scpVarianceAggregate()
combines the analysis of variance results
for groups of features. This is useful, for example, to
return protein-level results when data is modelled at the peptide
level. The function takes the list of tables generated by
scpVarianceAnalysis()
and returns a new list of DataFrame
s
with aggregated results.
scpAnnotateResults()
adds annotations to the component
analysis results. The annotations are added to all elements of the
list returned by scpComponentAnalysis()
. See the associated man
page for more information.
scpVariancePlot()
takes the list of tables generated by
scpVarianceAnalysis()
and returns a ggplot2
bar plot. The
bar plot shows the proportion of explained variance by each effect
and the residual variance. By default, the function will combine
the results over all features, showing the effect's contributions
on the complete data set. When combine = FALSE
, the results
are shown for individual features, with additional arguments to
control how many and which features are shown. Bars can also be
grouped by fcol
. This is particularly useful when exploring
peptide level results, but grouping peptides that belong to the
same protein (note that you should not use scpVarianceAggregate()
in that case).
Christophe Vanderaa, Laurent Gatto
ScpModel-Workflow to run a model on SCP data upstream of analysis of variance.
scpAnnotateResults()
to annotate analysis of variance results.
data("leduc_minimal")
####---- Run analysis of variance ----####
(var <- scpVarianceAnalysis(leduc_minimal))
####---- Annotate results ----####
## Add peptide annotations available from the rowData
var <- scpAnnotateResults(
var, rowData(leduc_minimal), by = "feature", by2 = "Sequence"
)
####---- Plot results ----####
## Plot the analysis of variance through the whole data
scpVariancePlot(var)
## Plot the analysis of variance for the top 20 peptides with highest
## percentage of variance explained by the cell type
scpVariancePlot(
var, effect = "SampleType", top = 20, combined = FALSE
)
## Same but grouped by protein
scpVariancePlot(
var, effect = "SampleType", top = 20, combined = FALSE, fcol = "gene"
)
####---- Aggregate results ----####
## Aggregate to protein-level results
varProtein <- scpVarianceAggregate(var, fcol = "gene")
scpVariancePlot(
varProtein, effect = "SampleType", top = 20, combined = FALSE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.