Skip to contents

Converts Seurat object to a MAMS object

Usage

convert_seurat_to_MAMS(object_list, observation_subsets, dataset_id)

Arguments

object_list

A named list of Seurat objects to be converted to MAMS format

observation_subsets

A vector with same length as object_list indicating the observation subset name for each Seurat object. One of: full, filtered, threshold, detected, nonartifact, clean.

dataset_id

Specify id of the dataset

Value

A MAMS object containing all the extracted metadata fields.

Examples

library(Seurat)
#> Loading required package: SeuratObject
#> Loading required package: sp
#> 
#> Attaching package: ‘SeuratObject’
#> The following objects are masked from ‘package:base’:
#> 
#>     intersect, t
options(Seurat.object.assay.version = "v3")
counts <- matrix(rpois((500*200), 1), nrow = 500, ncol = 200, 
    dimnames = list(paste0("Row", 1:500), paste0("Col", 1:200)))
srt <- CreateSeuratObject(counts = counts)
srt <- NormalizeData(srt)
subset_srt <- srt[, 1:100]
mams <- convert_seurat_to_MAMS(object_list = list(srt = srt, 
    subset_srt = subset_srt), observation_subsets = c("full", "subset"), 
    dataset_id = "dataset1")
print(mams)
#> An object of class "MAMS"
#> Slot "FOM":
#> $fom1
#> An object of class "FOM"
#> Slot "id":
#> [1] "fom1"
#> 
#> Slot "dataset_id":
#> [1] "dataset1"
#> 
#> Slot "filepath":
#> [1] "srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = srt, slot = \"counts\" assay = \"RNA\")"
#> 
#> Slot "data_type":
#> [1] "int"
#> 
#> Slot "representation":
#> [1] NA
#> 
#> Slot "representation_description":
#> [1] NA
#> 
#> Slot "obs_unit":
#> [1] NA
#> 
#> Slot "processing":
#> [1] "counts"
#> 
#> Slot "processing_description":
#> [1] NA
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] NA
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] NA
#> 
#> Slot "obs_subset_description":
#> [1] NA
#> 
#> Slot "feature_subset":
#> [1] NA
#> 
#> Slot "feature_subset_description":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "parent_id":
#> [1] NA
#> 
#> Slot "parent_relationship":
#> [1] NA
#> 
#> Slot "parent_relationship_description":
#> [1] NA
#> 
#> Slot "oid":
#> [1] "oid1"
#> 
#> Slot "fid":
#> [1] NA
#> 
#> Slot "obs":
#> [1] NA
#> 
#> Slot "fea":
#> [1] NA
#> 
#> Slot "ong":
#> [1] NA
#> 
#> Slot "fng":
#> [1] NA
#> 
#> 
#> $fom2
#> An object of class "FOM"
#> Slot "id":
#> [1] "fom2"
#> 
#> Slot "dataset_id":
#> [1] "dataset1"
#> 
#> Slot "filepath":
#> [1] "srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = srt, slot = \"data\" assay = \"RNA\")"
#> 
#> Slot "data_type":
#> [1] "double"
#> 
#> Slot "representation":
#> [1] NA
#> 
#> Slot "representation_description":
#> [1] NA
#> 
#> Slot "obs_unit":
#> [1] NA
#> 
#> Slot "processing":
#> [1] "lognormalized"
#> 
#> Slot "processing_description":
#> [1] NA
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] NA
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] NA
#> 
#> Slot "obs_subset_description":
#> [1] NA
#> 
#> Slot "feature_subset":
#> [1] NA
#> 
#> Slot "feature_subset_description":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "parent_id":
#> [1] NA
#> 
#> Slot "parent_relationship":
#> [1] NA
#> 
#> Slot "parent_relationship_description":
#> [1] NA
#> 
#> Slot "oid":
#> [1] "oid1"
#> 
#> Slot "fid":
#> [1] NA
#> 
#> Slot "obs":
#> [1] NA
#> 
#> Slot "fea":
#> [1] NA
#> 
#> Slot "ong":
#> [1] NA
#> 
#> Slot "fng":
#> [1] NA
#> 
#> 
#> $fom3
#> An object of class "FOM"
#> Slot "id":
#> [1] "fom3"
#> 
#> Slot "dataset_id":
#> [1] "dataset1"
#> 
#> Slot "filepath":
#> [1] "srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = srt, slot = \"scale.data\" assay = \"RNA\")"
#> 
#> Slot "data_type":
#> [1] "double"
#> 
#> Slot "representation":
#> [1] NA
#> 
#> Slot "representation_description":
#> [1] NA
#> 
#> Slot "obs_unit":
#> [1] NA
#> 
#> Slot "processing":
#> [1] "scaled"
#> 
#> Slot "processing_description":
#> [1] NA
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] NA
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] NA
#> 
#> Slot "obs_subset_description":
#> [1] NA
#> 
#> Slot "feature_subset":
#> [1] NA
#> 
#> Slot "feature_subset_description":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "parent_id":
#> [1] NA
#> 
#> Slot "parent_relationship":
#> [1] NA
#> 
#> Slot "parent_relationship_description":
#> [1] NA
#> 
#> Slot "oid":
#> [1] "oid1"
#> 
#> Slot "fid":
#> [1] NA
#> 
#> Slot "obs":
#> [1] NA
#> 
#> Slot "fea":
#> [1] NA
#> 
#> Slot "ong":
#> [1] NA
#> 
#> Slot "fng":
#> [1] NA
#> 
#> 
#> $fom4
#> An object of class "FOM"
#> Slot "id":
#> [1] "fom4"
#> 
#> Slot "dataset_id":
#> [1] "dataset1"
#> 
#> Slot "filepath":
#> [1] "subset_srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = subset_srt, slot = \"counts\" assay = \"RNA\")"
#> 
#> Slot "data_type":
#> [1] "int"
#> 
#> Slot "representation":
#> [1] NA
#> 
#> Slot "representation_description":
#> [1] NA
#> 
#> Slot "obs_unit":
#> [1] NA
#> 
#> Slot "processing":
#> [1] "counts"
#> 
#> Slot "processing_description":
#> [1] NA
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] NA
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] NA
#> 
#> Slot "obs_subset_description":
#> [1] NA
#> 
#> Slot "feature_subset":
#> [1] NA
#> 
#> Slot "feature_subset_description":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "parent_id":
#> [1] NA
#> 
#> Slot "parent_relationship":
#> [1] NA
#> 
#> Slot "parent_relationship_description":
#> [1] NA
#> 
#> Slot "oid":
#> [1] "oid2"
#> 
#> Slot "fid":
#> [1] NA
#> 
#> Slot "obs":
#> [1] NA
#> 
#> Slot "fea":
#> [1] NA
#> 
#> Slot "ong":
#> [1] NA
#> 
#> Slot "fng":
#> [1] NA
#> 
#> 
#> $fom5
#> An object of class "FOM"
#> Slot "id":
#> [1] "fom5"
#> 
#> Slot "dataset_id":
#> [1] "dataset1"
#> 
#> Slot "filepath":
#> [1] "subset_srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = subset_srt, slot = \"data\" assay = \"RNA\")"
#> 
#> Slot "data_type":
#> [1] "double"
#> 
#> Slot "representation":
#> [1] NA
#> 
#> Slot "representation_description":
#> [1] NA
#> 
#> Slot "obs_unit":
#> [1] NA
#> 
#> Slot "processing":
#> [1] "lognormalized"
#> 
#> Slot "processing_description":
#> [1] NA
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] NA
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] NA
#> 
#> Slot "obs_subset_description":
#> [1] NA
#> 
#> Slot "feature_subset":
#> [1] NA
#> 
#> Slot "feature_subset_description":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "parent_id":
#> [1] NA
#> 
#> Slot "parent_relationship":
#> [1] NA
#> 
#> Slot "parent_relationship_description":
#> [1] NA
#> 
#> Slot "oid":
#> [1] "oid2"
#> 
#> Slot "fid":
#> [1] NA
#> 
#> Slot "obs":
#> [1] NA
#> 
#> Slot "fea":
#> [1] NA
#> 
#> Slot "ong":
#> [1] NA
#> 
#> Slot "fng":
#> [1] NA
#> 
#> 
#> $fom6
#> An object of class "FOM"
#> Slot "id":
#> [1] "fom6"
#> 
#> Slot "dataset_id":
#> [1] "dataset1"
#> 
#> Slot "filepath":
#> [1] "subset_srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = subset_srt, slot = \"scale.data\" assay = \"RNA\")"
#> 
#> Slot "data_type":
#> [1] "double"
#> 
#> Slot "representation":
#> [1] NA
#> 
#> Slot "representation_description":
#> [1] NA
#> 
#> Slot "obs_unit":
#> [1] NA
#> 
#> Slot "processing":
#> [1] "scaled"
#> 
#> Slot "processing_description":
#> [1] NA
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] NA
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] NA
#> 
#> Slot "obs_subset_description":
#> [1] NA
#> 
#> Slot "feature_subset":
#> [1] NA
#> 
#> Slot "feature_subset_description":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "parent_id":
#> [1] NA
#> 
#> Slot "parent_relationship":
#> [1] NA
#> 
#> Slot "parent_relationship_description":
#> [1] NA
#> 
#> Slot "oid":
#> [1] "oid2"
#> 
#> Slot "fid":
#> [1] NA
#> 
#> Slot "obs":
#> [1] NA
#> 
#> Slot "fea":
#> [1] NA
#> 
#> Slot "ong":
#> [1] NA
#> 
#> Slot "fng":
#> [1] NA
#> 
#> 
#> 
#> Slot "FEA":
#> list()
#> 
#> Slot "OBS":
#> list()
#> 
#> Slot "FID":
#> list()
#> 
#> Slot "OID":
#> list()
#> 
#> Slot "REC":
#> list()
#> 
#> Slot "ONG":
#> list()
#> 
#> Slot "FNG":
#> list()
#>