This function aggregates the quantitative features of an assay,
applying a summarization function (fun
) to sets of features.
The fcol
variable name points to a rowData column that defines
how to group the features during aggregate. This variable has to
be an adjacency matrix. This function uses QFeatures::aggregateFeatures()
to aggregate quantitative data.
The list of agregation methods can be obtained with the function
aggregateMethods()
. This function compiles both methods from the
packages DaparToolshed
and QFeatures
.
xxx
Usage
aggregateFeatures4Prostar(object, ...)
# S4 method for class 'QFeatures'
aggregateFeatures4Prostar(
object,
i,
fcol,
name = "newAssay",
fun = MsCoreUtils::robustSummary,
shared = TRUE,
n = NULL,
...
)
# S4 method for class 'SummarizedExperiment'
aggregateFeatures4Prostar(
object,
fcol,
fun = MsCoreUtils::robustSummary,
conds,
shared = TRUE,
n = NULL,
...
)
aggQmetacell(qMeta, X, level, conds)
aggregateMethods()
Arguments
- object
An instance of class
QFeatures
orSummarizedExperiment
- ...
Additional parameters passed the
fun
.- i
The index or name of the assay which features will be aggregated the create the new assay.
- fcol
A
character(1)
naming a rowdata variable (of assayi
in case of aQFeatures
) defining how to aggregate the features of the assay. This variable is a (possibly sparse) matrix. See below for details.- name
A
character(1)
naming the new assay. Default isnewAssay
. Note that the function will fail if there's already an assay withname
.- fun
A function used for quantitative feature aggregation. See details for examples.
A
boolean
indication if shared peptides should be considered. IfTRUE
, shared peptides- n
A
numeric(1)
specifying the number of peptides to use for each protein. IfNULL
, all peptides are considered.- conds
A
character()
vector which is the names of conditions for each sample in the dataset.- qMeta
An object of class 'SummarizedExperiment'
- X
xxxx
- level
A
character(1)
which is the type of dataset
Value
A QFeatures
object with an additional assay or a SummarizedExperiment
object (or subclass thereof).
xxxxx
Details
This function uses QFeatures::aggregateFeatures()
to aggregate quantitative data.
Quantitative metadata aggregation
The function to aggregate the quantitative metadata is aggQmetadat()
.
See also
The QFeatures vignette provides an extended example and the Aggregation vignette, for a complete quantitative proteomics data processing pipeline.
Examples
## ---------------------------------------
## An example QFeatures with PSM-level data
## ---------------------------------------
if (FALSE) { # \dontrun{
library(SummarizedExperiment)
data(ft, package='DaparToolshed')
ft
## Aggregate peptides into proteins
## using the adjacency matrix
feat1 <- aggregateFeatures4Prostar(object = ft,
i = 1,
name = 'aggregated',
fcol = 'adjacencyMatrix',
fun = 'colSumsMat')
feat1
assay(feat1[[1]])
assay(feat1[[2]])
aggcounts(feat1[[2]])
assay(feat1[[3]])
aggcounts(feat1[[3]])
rowData(feat1[[2]])
} # }
data(ft, package='DaparToolshed')
qMeta <- qMetacell(ft, 1)
X <- QFeatures::adjacencyMatrix(ft[[1]])
level <- typeDataset(ft[[1]])
conds <- SummarizedExperiment::colData(ft)$Condition
aggQmeta <- aggQmetacell(qMeta, X, level, conds)