aggregateFeaturesOverAssays {scp} | R Documentation

## Aggregate features over multiple assays

### Description

This function is a wrapper function around QFeatures::aggregateFeatures. It allows the user to provide multiple assays for which `aggregateFeatures` will be applied sequentially.

### Usage

    aggregateFeaturesOverAssays(object, i, fcol, name, fun, ...)

### Arguments

`object` | A `QFeatures` object
`i` | A `numeric(1)` or `character(1)` indicating which assay to transfer the `colData` to.
`fcol` | The feature variables for each assays `i` defining how to summarise the QFeatures. If `fcol` has length 1, the variable name is assumed to be the same for all assays
`name` | A `character()` naming the new assay. `name` must have the same length as `i`. Note that the function will fail if of the names in `name` is already present.
`fun` | A function used for quantitative feature aggregation.
`...` | Additional parameters passed the `fun`.

### Value

A `QFeatures` object

### See Also

QFeatures::aggregateFeatures

### Examples

    data("scp1")
    scp1 <- aggregateFeaturesOverAssays(scp1,
                                        i = 1:3,
                                        fcol = "peptide",
                                        name = paste0("peptides", 1:3),
                                        fun = colMeans,
                                        na.rm = TRUE)
    scp1

[Package scp version 1.4.0 Index]