predictSignatures: Predict Method for Collection of Gene Set Signatures

Description Usage Arguments Value Functions Prediction methods Author(s) See Also Examples

Description

These method signatures apply gene set signatures optionally augmented with (semi-)quantitative information to the prediction of sample and cell identities in SummarizedExperiment objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
barplotPredictionCount(se, highlight = character(0), labels = TRUE)

barplotPredictionProportion(se, highlight = character(0),
  labels = TRUE)

reducedDimPrediction(se, highlight = character(0), redDimType = "PCA",
  x = 1, y = 2, labels = TRUE)

## S3 method for class 'GeneSetCollection'
predict(object, se, assay.type = "counts",
  method = c("ProportionPositive", "PP"), ...)

## S3 method for class 'Sets'
predict(object, se, assay.type = "counts",
  method = c("ProportionPositive", "PP"), ...)

Arguments

se

An object of class inheriting from SummarizedExperiment.

highlight

Character vector indicating names of signatures to highlight.

labels

Logical value indicating whether to display labels.

redDimType

Name of the reduced dimension result type to display.

x

Name of the covariate to display on the x-axis.

y

Name of the covariate to display on the y-axis.

object

A set of signatures of class inheriting from Sets or GeneSetCollection.

assay.type

A string specifying which assay values to use, e.g., "counts" or "logcounts".

method

Prediction method. See section "Prediction methods".

...

Additional arguments affecting the predictions produced.

Value

The object se, updated as follows:

Functions

Prediction methods

ProportionPositive, PP

Requires prior cluster membership information. Computes the proportion of samples positive for each signature in each cluster. Assigns to each cluster the signature detected in the highest proportion of samples.

Author(s)

Kevin Rue-Albrecht

See Also

predictByProportionPositive.

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
# Example data ----
library(SummarizedExperiment)
nsamples <- 100
u <- matrix(rpois(20000, 2), ncol=nsamples)
rownames(u) <- paste0("Gene", sprintf("%03d", seq_len(nrow(u))))
colnames(u) <- paste0("Cell", sprintf("%03d", seq_len(ncol(u))))
se <- SummarizedExperiment(assays=list(counts=u))

bs <- Sets(
    relations=DataFrame(
        element = c("Gene001", "Gene002", "Gene003", "Gene004"),
        set     = c(rep("Cell type 1", 2), rep("Cell type 2", 2))
    )
)

# Example usage ----

se1 <- se
colData(se1)[, "cluster"] <- factor(sample(head(LETTERS, 3), ncol(se1), replace=TRUE))
se1 <- predict(bs, se1, method="ProportionPositive", cluster.col="cluster")
# Visualise the count of samples predicted for each signature in each cluster
barplotPredictionCount(se1, highlight=c("Cell type 1"))

barplotPredictionProportion(se1, highlight=c("Cell type 2"))

library(SingleCellExperiment)
sce1 <- as(se1, "SingleCellExperiment")
reducedDim(sce1, "PCA") <- prcomp(t(assay(sce1)))$x
reducedDimPrediction(sce1, highlight="Cell type 1", redDimType="PCA", x=1, y=2)

kevinrue/hancock documentation built on May 17, 2020, 7:55 a.m.