QFeatures-class: Quantitative MS QFeatures

Description Usage Arguments Value Constructors Accessors Adding assays Subsetting Author(s) See Also Examples

Description

Conceptually, a QFeatures object holds a set of assays, each composed of a matrix (or array) containing quantitative data and row annotations (meta-data). The number and the names of the columns (samples) must always be the same across the assays, but the number and the names of the rows (features) can vary. The assays are typically defined as SummarizedExperiment objects. In addition, a QFeatures object also uses a single DataFrame to annotate the samples (columns) represented in all the matrices.

The QFeatures class extends the MultiAssayExperiment::MultiAssayExperiment and inherits all the functionality of the MultiAssayExperiment::MultiAssayExperiment class.

A typical use case for such QFeatures object is to represent quantitative proteomics (or metabolomics) data, where different assays represent quantitation data at the PSM (the main assay), peptide and protein level, and where peptide values are computed from the PSM data, and the protein-level data is calculated based on the peptide-level values. The largest assay (the one with the highest number of features, PSMs in the example above) is considered the main assay.

The recommended way to create QFeatures objects is the use the readQFeatures() function, that creates an instance from tabular data. The QFeatures constructor can be used to create objects from their bare parts. It is the user's responsability to make sure that these match the class validity requirements.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## S4 method for signature 'QFeatures'
show(object)

## S4 method for signature 'QFeatures,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]

## S4 method for signature 'QFeatures'
dims(x)

## S4 method for signature 'QFeatures,character,ANY,ANY'
x[i, j, k, ..., drop = TRUE]

## S4 method for signature 'QFeatures'
rowData(x, use.names = TRUE, ...)

selectRowData(x, rowvars)

rowDataNames(x)

## S4 replacement method for signature 'QFeatures,character'
names(x) <- value

longFormat(object, colDataCols = NULL, rowDataCols = NULL, index = 1L)

QFeatures(..., assayLinks = NULL)

addAssay(x, y, name = "newAssay", assayLinks = AssayLinks(names = name))

Arguments

object

An instance of class QFeatures.

x

An instance of class QFeatures.

i

character(), integer(), logical() or GRanges() object for subsetting by rows.

j

character(), logical(), or numeric() vector for subsetting by colData rows.

...

See MultiAssayExperiment for details.

drop

logical (default TRUE) whether to drop empty assay elements in the ExperimentList.

k

character(), logical(), or numeric() vector for subsetting by assays

use.names

A logical(1) indicating whether the rownames of each assay should be propagated to the corresponding rowData.

rowvars

A character() with the names of the rowData variables (columns) to retain in any assay. All other variables will be dropped. In case an element in rowvars isn't found in any rowData variable, a message is printed.

value

A character() with new name(s) for the assay(s) in x

colDataCols

A character(), logical(), or numeric() index for colData columns to be included.

rowDataCols

A character() index for colData columns to be included.

index

The assay indicator for SummarizedExperiment objects. A vector input is supported in the case that the SummarizedExperiment object(s) has more than one assay (default 1L)

assayLinks

An optional AssayLinks.

y

A single assay or a named list of assays.

name

A character(1) naming the single assay (default is "newAssay"). Ignored if y is a list of assays.

Value

See individual method description for the return value.

Constructors

Accessors

Adding assays

Subsetting

Author(s)

Laurent Gatto

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## ------------------------
## An empty QFeatures object
## ------------------------

QFeatures()

## -----------------------------------
## Creating a QFeatures object manually
## -----------------------------------

## two assays (matrices) with matching column names
m1 <- matrix(1:40, ncol = 4)
m2 <- matrix(1:16, ncol = 4)
sample_names <- paste0("S", 1:4)
colnames(m1) <- colnames(m2) <- sample_names
rownames(m1) <- letters[1:10]
rownames(m2) <- letters[1:4]

## two corresponding feature metadata with appropriate row names
df1 <- DataFrame(Fa = 1:10, Fb = letters[1:10],
                 row.names = rownames(m1))
df2 <- DataFrame(row.names = rownames(m2))

(se1 <- SummarizedExperiment(m1, df1))
(se2 <- SummarizedExperiment(m2, df2))

## Sample annotation (colData)
cd <- DataFrame(Var1 = rnorm(4),
                Var2 = LETTERS[1:4],
                row.names = sample_names)

el <- list(assay1 = se1, assay2 = se2)
fts1 <- QFeatures(el, colData = cd)
fts1
fts1[[1]]
fts1[["assay1"]]

## Rename assay
names(fts1) <- c("se1", "se2")

## Add an assay
fts1 <- addAssay(fts1, se1[1:2, ], name = "se3")

## Get the assays feature metadata
rowData(fts1) 

## Keep only the Fa variable
selectRowData(fts1, rowvars = "Fa")

## -----------------------------------
## See ?readQFeatures to create a
## QFeatures object from a data.frame
## or spreadsheet.
## -----------------------------------

QFeatures documentation built on Nov. 8, 2020, 6:51 p.m.