Title: | Integrative Bulk and Single-Cell Experiment Container |
---|---|
Description: | MultimodalExperiment is an S4 class that integrates bulk and single-cell experiment data; it is optimally storage-efficient, and its methods are exceptionally fast. It effortlessly represents multimodal data of any nature and features normalized experiment, subject, sample, and cell annotations, which are related to underlying biological experiments through maps. Its coordination methods are opt-in and employ database-like join operations internally to deliver fast and flexible management of multimodal data. |
Authors: | Lucas Schiffer [aut, cre] |
Maintainer: | Lucas Schiffer <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.7.0 |
Built: | 2024-10-30 08:25:34 UTC |
Source: | https://github.com/bioc/MultimodalExperiment |
joinAnnotations
joins all annotations into an unnormalized
DataFrame object.
## S4 method for signature 'MultimodalExperiment' joinAnnotations(x)
## S4 method for signature 'MultimodalExperiment' joinAnnotations(x)
x |
a MultimodalExperiment object |
joinAnnotations
returns a DataFrame
object.
browseVignettes("MultimodalExperiment")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) joinAnnotations(ME)
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) joinAnnotations(ME)
Propagate or harmonize indices of a MultimodalExperiment object.
## S4 method for signature 'MultimodalExperiment' propagate(x) ## S4 method for signature 'MultimodalExperiment' harmonize(x)
## S4 method for signature 'MultimodalExperiment' propagate(x) ## S4 method for signature 'MultimodalExperiment' harmonize(x)
x |
a MultimodalExperiment object |
propagate
inserts experiment, subject, sample, and cell indices into all
relevant tables by taking their union and adding missing indices.
harmonize
deletes experiment, subject, sample, and cell indices from all
relevant tables by taking their intersection and removing extraneous indices.
propagate
returns a MultimodalExperiment object.
harmonize
returns a MultimodalExperiment object.
browseVignettes("MultimodalExperiment")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) isMonocyte <- cellData(ME)[["cellType"]] %in% "Monocyte" cellData(ME) <- cellData(ME)[isMonocyte, , drop = FALSE] harmonize(ME)
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) isMonocyte <- cellData(ME)[["cellType"]] %in% "Monocyte" cellData(ME) <- cellData(ME)[isMonocyte, , drop = FALSE] harmonize(ME)
Human peripheral blood mononuclear cells (PBMCs) from a single healthy donor
were profiled by cellular indexing of transcriptomes and epitopes by
sequencing (CITE-seq) to generate single-cell antibody-derived tag sequencing
(scADTseq
) and single-cell RNA sequencing (scRNAseq
) data simultaneously;
the scRNAseq
data was summed into pseudo-bulk RNA sequencing (pbRNAseq
)
data. The dimensions of resulting matrices were reduced to conserve storage
because these data are only used to demonstrate the functionality of the
MultimodalExperiment class.
pbRNAseq scADTseq scRNAseq
pbRNAseq scADTseq scRNAseq
An object of class matrix
(inherits from array
) with 3000 rows and 1 columns.
An object of class matrix
(inherits from array
) with 8 rows and 5000 columns.
An object of class matrix
(inherits from array
) with 3000 rows and 5000 columns.
PBMCs of a Healthy Donor - 5' Gene Expression with a Panel of TotalSeqâ„¢-C Antibodies, Single Cell Immune Profiling Dataset by Cell Ranger 3.0.0, 10x Genomics, (2018, November 19).
pbRNAseq[1:4, 1:1, drop = FALSE] scADTseq[1:4, 1:4, drop = FALSE] scRNAseq[1:4, 1:4, drop = FALSE]
pbRNAseq[1:4, 1:1, drop = FALSE] scADTseq[1:4, 1:4, drop = FALSE] scRNAseq[1:4, 1:4, drop = FALSE]
Extract or replace experiments of a MultimodalExperiment object by index, name, or type.
## S4 method for signature 'MultimodalExperiment' experiment(x, i) ## S4 replacement method for signature 'MultimodalExperiment' experiment(x, i) <- value ## S4 method for signature 'MultimodalExperiment' bulkExperiments(x) ## S4 replacement method for signature 'MultimodalExperiment' bulkExperiments(x) <- value ## S4 method for signature 'MultimodalExperiment' singleCellExperiments(x) ## S4 replacement method for signature 'MultimodalExperiment' singleCellExperiments(x) <- value
## S4 method for signature 'MultimodalExperiment' experiment(x, i) ## S4 replacement method for signature 'MultimodalExperiment' experiment(x, i) <- value ## S4 method for signature 'MultimodalExperiment' bulkExperiments(x) ## S4 replacement method for signature 'MultimodalExperiment' bulkExperiments(x) <- value ## S4 method for signature 'MultimodalExperiment' singleCellExperiments(x) ## S4 replacement method for signature 'MultimodalExperiment' singleCellExperiments(x) <- value
x |
a MultimodalExperiment object |
i |
an integer or character index |
value |
a replacement value |
The term matrix-like objects refers to matrix objects or Bioconductor S4 objects that contain them ( SummarizedExperiment, SingleCellExperiment, etc.) where rows represent features and columns represent observations.
experiment
returns a matrix-like object.
bulkExperiments
returns an ExperimentList of matrix-like objects.
singleCellExperiments
returns an ExperimentList of matrix-like objects.
browseVignettes("MultimodalExperiment")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) experiment(ME, 2L) <- experiment(ME, 2L)[1:4, 1:4] experiment(ME, 2L) experiment(ME, "scRNAseq") <- experiment(ME, "scRNAseq")[1:4, 1:4] experiment(ME, "scRNAseq") bulkExperiments(ME) <- bulkExperiments(ME)[1L] bulkExperiments(ME) singleCellExperiments(ME) <- singleCellExperiments(ME)[2L] singleCellExperiments(ME)
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) experiment(ME, 2L) <- experiment(ME, 2L)[1:4, 1:4] experiment(ME, 2L) experiment(ME, "scRNAseq") <- experiment(ME, "scRNAseq")[1:4, 1:4] experiment(ME, "scRNAseq") bulkExperiments(ME) <- bulkExperiments(ME)[1L] bulkExperiments(ME) singleCellExperiments(ME) <- singleCellExperiments(ME)[2L] singleCellExperiments(ME)
joinMaps
joins all maps into an unnormalized
DataFrame object.
## S4 method for signature 'MultimodalExperiment' joinMaps(x)
## S4 method for signature 'MultimodalExperiment' joinMaps(x)
x |
a MultimodalExperiment object |
joinMaps
returns a DataFrame object.
browseVignettes("MultimodalExperiment")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) joinMaps(ME)
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) joinMaps(ME)
MultimodalExperiment
constructs a MultimodalExperiment object.
MultimodalExperiment( experimentData = DataFrame(), subjectData = DataFrame(), sampleData = DataFrame(), cellData = DataFrame(), experimentMap = DataFrame( type = character(), experiment = character() ), subjectMap = DataFrame( experiment = character(), subject = character() ), sampleMap = DataFrame( subject = character(), sample = character() ), cellMap = DataFrame( sample = character(), cell = character() ), experiments = ExperimentList(), metadata = list() )
MultimodalExperiment( experimentData = DataFrame(), subjectData = DataFrame(), sampleData = DataFrame(), cellData = DataFrame(), experimentMap = DataFrame( type = character(), experiment = character() ), subjectMap = DataFrame( experiment = character(), subject = character() ), sampleMap = DataFrame( subject = character(), sample = character() ), cellMap = DataFrame( sample = character(), cell = character() ), experiments = ExperimentList(), metadata = list() )
experimentData |
a DataFrame of experiment annotations with experiment indices as rownames |
subjectData |
a DataFrame of subject annotations with subject indices as rownames |
sampleData |
a DataFrame of sample annotations with sample indices as rownames |
cellData |
a DataFrame of cell annotations with cell indices as rownames |
experimentMap |
a DataFrame of type (bulk or single-cell) to experiment (index) mappings |
subjectMap |
a DataFrame of experiment (index) to subject (index) mappings |
sampleMap |
a DataFrame of subject (index) to sample (index) mappings |
cellMap |
a DataFrame of sample (index) to cell (index) mappings |
experiments |
an ExperimentList of matrix-like objects |
metadata |
a list of metadata objects |
The term matrix-like objects refers to matrix objects or Bioconductor S4 objects that contain them ( SummarizedExperiment, SingleCellExperiment, etc.) where rows represent features and columns represent observations.
MultimodalExperiment
returns a MultimodalExperiment
object.
browseVignettes("MultimodalExperiment")
MultimodalExperiment()
MultimodalExperiment()
MultimodalExperiment is an S4 class that integrates bulk and single-cell experiment data; it is optimally storage-efficient, and its methods are exceptionally fast. It effortlessly represents multimodal data of any nature and features normalized experiment, subject, sample, and cell annotations, which are related to underlying biological experiments through maps. Its coordination methods are opt-in and employ database-like join operations internally to deliver fast and flexible management of multimodal data.
The term matrix-like objects refers to matrix objects or Bioconductor S4 objects that contain them ( SummarizedExperiment, SingleCellExperiment, etc.) where rows represent features and columns represent observations.
experimentData
a DataFrame of experiment annotations with experiment indices as rownames
subjectData
a DataFrame of subject annotations with subject indices as rownames
sampleData
a DataFrame of sample annotations with sample indices as rownames
cellData
a DataFrame of cell annotations with cell indices as rownames
experimentMap
a DataFrame of type (bulk or single-cell) to experiment (index) mappings
subjectMap
a DataFrame of experiment (index) to subject (index) mappings
sampleMap
a DataFrame of subject (index) to sample (index) mappings
cellMap
a DataFrame of sample (index) to cell (index) mappings
experiments
an ExperimentList of matrix-like objects
metadata
a list of metadata objects
browseVignettes("MultimodalExperiment")
Extract or replace names of a MultimodalExperiment object.
## S4 method for signature 'MultimodalExperiment' names(x) ## S4 replacement method for signature 'MultimodalExperiment' names(x) <- value ## S4 method for signature 'MultimodalExperiment' rownames(x) ## S4 replacement method for signature 'MultimodalExperiment' rownames(x) <- value ## S4 method for signature 'MultimodalExperiment' colnames(x) ## S4 replacement method for signature 'MultimodalExperiment,ANY' colnames(x) <- value ## S4 method for signature 'MultimodalExperiment' dimnames(x) ## S4 replacement method for signature 'MultimodalExperiment,ANY' dimnames(x) <- value ## S4 method for signature 'MultimodalExperiment' experimentNames(x) ## S4 replacement method for signature 'MultimodalExperiment' experimentNames(x) <- value
## S4 method for signature 'MultimodalExperiment' names(x) ## S4 replacement method for signature 'MultimodalExperiment' names(x) <- value ## S4 method for signature 'MultimodalExperiment' rownames(x) ## S4 replacement method for signature 'MultimodalExperiment' rownames(x) <- value ## S4 method for signature 'MultimodalExperiment' colnames(x) ## S4 replacement method for signature 'MultimodalExperiment,ANY' colnames(x) <- value ## S4 method for signature 'MultimodalExperiment' dimnames(x) ## S4 replacement method for signature 'MultimodalExperiment,ANY' dimnames(x) <- value ## S4 method for signature 'MultimodalExperiment' experimentNames(x) ## S4 replacement method for signature 'MultimodalExperiment' experimentNames(x) <- value
x |
a MultimodalExperiment object |
value |
a replacement value |
names
returns a CharacterList object.
rownames
returns a CharacterList object.
colnames
returns a CharacterList object.
dimnames
returns a list object.
experimentNames
returns a character vector.
browseVignettes("MultimodalExperiment")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) names(ME) <- names(ME) |> tolower() names(ME) rownames(ME) <- rownames(ME) |> toupper() rownames(ME) colnames(ME) <- colnames(ME) |> tolower() colnames(ME) dimnames(ME)[[2L]] <- dimnames(ME)[[2L]] |> toupper() dimnames(ME)[[2L]] experimentNames(ME) <- experimentNames(ME) |> gsub(pattern = "seq", replacement = "-seq") experimentNames(ME)
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) names(ME) <- names(ME) |> tolower() names(ME) rownames(ME) <- rownames(ME) |> toupper() rownames(ME) colnames(ME) <- colnames(ME) |> tolower() colnames(ME) dimnames(ME)[[2L]] <- dimnames(ME)[[2L]] |> toupper() dimnames(ME)[[2L]] experimentNames(ME) <- experimentNames(ME) |> gsub(pattern = "seq", replacement = "-seq") experimentNames(ME)
Extract or replace slots of a MultimodalExperiment object.
## S4 method for signature 'MultimodalExperiment' experimentData(object) ## S4 replacement method for signature 'MultimodalExperiment' experimentData(object) <- value ## S4 method for signature 'MultimodalExperiment' subjectData(object) ## S4 replacement method for signature 'MultimodalExperiment' subjectData(object) <- value ## S4 method for signature 'MultimodalExperiment' sampleData(object) ## S4 replacement method for signature 'MultimodalExperiment' sampleData(object) <- value ## S4 method for signature 'MultimodalExperiment' cellData(object) ## S4 replacement method for signature 'MultimodalExperiment' cellData(object) <- value ## S4 method for signature 'MultimodalExperiment' experimentMap(object) ## S4 replacement method for signature 'MultimodalExperiment' experimentMap(object) <- value ## S4 method for signature 'MultimodalExperiment' subjectMap(object) ## S4 replacement method for signature 'MultimodalExperiment' subjectMap(object) <- value ## S4 method for signature 'MultimodalExperiment' sampleMap(object) ## S4 replacement method for signature 'MultimodalExperiment' sampleMap(object) <- value ## S4 method for signature 'MultimodalExperiment' cellMap(object) ## S4 replacement method for signature 'MultimodalExperiment' cellMap(object) <- value ## S4 method for signature 'MultimodalExperiment' experiments(object) ## S4 replacement method for signature 'MultimodalExperiment' experiments(object) <- value
## S4 method for signature 'MultimodalExperiment' experimentData(object) ## S4 replacement method for signature 'MultimodalExperiment' experimentData(object) <- value ## S4 method for signature 'MultimodalExperiment' subjectData(object) ## S4 replacement method for signature 'MultimodalExperiment' subjectData(object) <- value ## S4 method for signature 'MultimodalExperiment' sampleData(object) ## S4 replacement method for signature 'MultimodalExperiment' sampleData(object) <- value ## S4 method for signature 'MultimodalExperiment' cellData(object) ## S4 replacement method for signature 'MultimodalExperiment' cellData(object) <- value ## S4 method for signature 'MultimodalExperiment' experimentMap(object) ## S4 replacement method for signature 'MultimodalExperiment' experimentMap(object) <- value ## S4 method for signature 'MultimodalExperiment' subjectMap(object) ## S4 replacement method for signature 'MultimodalExperiment' subjectMap(object) <- value ## S4 method for signature 'MultimodalExperiment' sampleMap(object) ## S4 replacement method for signature 'MultimodalExperiment' sampleMap(object) <- value ## S4 method for signature 'MultimodalExperiment' cellMap(object) ## S4 replacement method for signature 'MultimodalExperiment' cellMap(object) <- value ## S4 method for signature 'MultimodalExperiment' experiments(object) ## S4 replacement method for signature 'MultimodalExperiment' experiments(object) <- value
object |
a MultimodalExperiment object |
value |
a replacement value |
Extract methods return the value of the slot.
browseVignettes("MultimodalExperiment")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) experimentData(ME) subjectData(ME) sampleData(ME) cellData(ME) experimentMap(ME) subjectMap(ME) sampleMap(ME) cellMap(ME) experiments(ME)
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) experimentData(ME) subjectData(ME) sampleData(ME) cellData(ME) experimentMap(ME) subjectMap(ME) sampleMap(ME) cellMap(ME) experiments(ME)
Extract or replace parts of a MultimodalExperiment object.
## S4 method for signature 'MultimodalExperiment,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 replacement method for signature 'MultimodalExperiment,ANY,ANY,ANY' x[i, j] <- value
## S4 method for signature 'MultimodalExperiment,ANY,ANY,ANY' x[i, j, ..., drop = FALSE] ## S4 replacement method for signature 'MultimodalExperiment,ANY,ANY,ANY' x[i, j] <- value
x |
a MultimodalExperiment object |
i |
a list, List, LogicalList, IntegerList, or CharacterList of elements to extract or replace |
j |
a list, List, LogicalList, IntegerList, or CharacterList of elements to extract or replace |
... |
ignored, required by generic |
drop |
ignored, required by generic |
value |
a replacement value |
[
returns a MultimodalExperiment object.
browseVignettes("MultimodalExperiment")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) i <- rownames(ME) |> endoapply(sample, 4L) j <- colnames(ME) |> endoapply(sample, 1L) ME[i, j] <- 0L experiment(ME[i, j], "pbRNAseq") experiment(ME[i, j], "scADTseq") experiment(ME[i, j], "scRNAseq")
ME <- MultimodalExperiment() bulkExperiments(ME) <- ExperimentList( pbRNAseq = pbRNAseq ) singleCellExperiments(ME) <- ExperimentList( scADTseq = scADTseq, scRNAseq = scRNAseq ) subjectMap(ME)[["subject"]] <- "SUBJECT-1" sampleMap(ME)[["subject"]] <- "SUBJECT-1" cellMap(ME)[["sample"]] <- "SAMPLE-1" ME <- propagate(ME) experimentData(ME)[["published"]] <- c(NA_character_, "2018-11-19", "2018-11-19") |> as.Date() subjectData(ME)[["condition"]] <- as.character("healthy") sampleData(ME)[["sampleType"]] <- as.character("peripheral blood mononuclear cells") cellType <- function(x) { if (x[["CD4"]] > 0L) { return("T Cell") } if (x[["CD14"]] > 0L) { return("Monocyte") } if (x[["CD19"]] > 0L) { return("B Cell") } if (x[["CD56"]] > 0L) { return("NK Cell") } NA_character_ } cellData(ME)[["cellType"]] <- experiment(ME, "scADTseq") |> apply(2L, cellType) i <- rownames(ME) |> endoapply(sample, 4L) j <- colnames(ME) |> endoapply(sample, 1L) ME[i, j] <- 0L experiment(ME[i, j], "pbRNAseq") experiment(ME[i, j], "scADTseq") experiment(ME[i, j], "scRNAseq")