Skip to contents

Converts Seurat object to a MAMS object

Usage

convert_seurat_to_MAMS(
  object_list,
  observation_subsets,
  dataset_id,
  parent_list
)

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

parent_list

A named list that specifies which is the parent dataset

Value

A MAMS object containing all the extracted metadata fields.

Examples

library(Seurat)
#> Loading required package: SeuratObject
#> Loading required package: sp
#> ‘SeuratObject’ was built under R 4.4.0 but the current version is
#> 4.4.1; it is recomended that you reinstall ‘SeuratObject’ as the ABI
#> for R may have changed
#> 
#> 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",parent_list = c("yes","no"))
#> Warning: Layer ‘scale.data’ is empty
#> Warning: Layer ‘scale.data’ is empty
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] "dense"
#> 
#> Slot "representation_description":
#> [1] "The matrix contains zeros for the majority of the measurements"
#> 
#> Slot "obs_unit":
#> [1] "cell"
#> 
#> Slot "obs_unit_description":
#> [1] "Features are quantified for individual cells, ex: Single-cell RNA-seq"
#> 
#> Slot "processing":
#> [1] "counts"
#> 
#> Slot "processing_description":
#> [1] "Raw data for assays that produce integer-like data such as scRNA-seq.Child of raw"
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] " Used for technologies that measure RNA expression levels.This should generally be used for assays listed under “RNA assay” (EFO_0001457) from the OLS.\n                    dna\tUsed for technologies that measure features of DNA.\tThis should generally be used for assays listed under “DNA assay” (EFO_0001456) from the OLS."
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] "full"
#> 
#> Slot "obs_subset_description":
#> [1] "Observations have not been filtered or subsetted."
#> 
#> Slot "feature_subset":
#> [1] "full"
#> 
#> Slot "feature_subset_description":
#> [1] "Features have not been filtered or subsetted."
#> 
#> Slot "record_id":
#> [1] "CellRanger.count"
#> 
#> Slot "parent_id":
#> [1] "fom1"
#> 
#> Slot "parent_relationship":
#> [1] "Parent"
#> 
#> Slot "parent_relationship_description":
#> [1] "This is the parent_matrix"
#> 
#> Slot "oid":
#> [1] "oid1"
#> 
#> Slot "fid":
#> [1] "fid1"
#> 
#> Slot "obs":
#> [1] "obs1"
#> 
#> Slot "fea":
#> [1] "fea1"
#> 
#> 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] "dense"
#> 
#> Slot "representation_description":
#> [1] "The matrix contains non-zeros for the majority of the measurements"
#> 
#> Slot "obs_unit":
#> [1] "cell"
#> 
#> Slot "obs_unit_description":
#> [1] "Features are quantified for individual cells, ex: Single-cell RNA-seq"
#> 
#> Slot "processing":
#> [1] "logNormalize"
#> 
#> Slot "processing_description":
#> NULL
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] " Used for technologies that measure RNA expression levels.This should generally be used for assays listed under “RNA assay” (EFO_0001457) from the OLS.\n                    dna\tUsed for technologies that measure features of DNA.\tThis should generally be used for assays listed under “DNA assay” (EFO_0001456) from the OLS."
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] "full"
#> 
#> Slot "obs_subset_description":
#> [1] "Observations have not been filtered or subsetted."
#> 
#> Slot "feature_subset":
#> [1] "full"
#> 
#> Slot "feature_subset_description":
#> [1] "Features have not been filtered or subsetted."
#> 
#> Slot "record_id":
#> [1] "NormalizeData.rna"
#> 
#> Slot "parent_id":
#> [1] "fom1"
#> 
#> Slot "parent_relationship":
#> [1] "transformation"
#> 
#> Slot "parent_relationship_description":
#> [1] "Values have been modified but feature and observation dimensions are the same.\tNormalization and Log2 transformation"
#> 
#> Slot "oid":
#> [1] "oid1"
#> 
#> Slot "fid":
#> [1] "fid1"
#> 
#> Slot "obs":
#> [1] "obs1"
#> 
#> Slot "fea":
#> [1] "fea1"
#> 
#> 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] "dense"
#> 
#> Slot "representation_description":
#> [1] "The matrix contains non-zeros for the majority of the measurements"
#> 
#> Slot "obs_unit":
#> [1] "cell"
#> 
#> Slot "obs_unit_description":
#> [1] "Features are quantified for individual cells, ex: Single-cell RNA-seq"
#> 
#> Slot "processing":
#> [1] "scaled"
#> 
#> Slot "processing_description":
#> [1] "Data with features have been centered around a standard quantity and standardized to have similar variances or ranges.\tZ-scored data"
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] " Used for technologies that measure RNA expression levels.This should generally be used for assays listed under “RNA assay” (EFO_0001457) from the OLS.\n                    dna\tUsed for technologies that measure features of DNA.\tThis should generally be used for assays listed under “DNA assay” (EFO_0001456) from the OLS."
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] "full"
#> 
#> Slot "obs_subset_description":
#> [1] "Observations have not been filtered or subsetted."
#> 
#> Slot "feature_subset":
#> [1] "variable"
#> 
#> Slot "feature_subset_description":
#> [1] "Features that have minimum level of variability across all cells"
#> 
#> Slot "record_id":
#> [1] "ScaleData.rna"
#> 
#> Slot "parent_id":
#> [1] "fom2"
#> 
#> Slot "parent_relationship":
#> [1] "transformation"
#> 
#> Slot "parent_relationship_description":
#> [1] "Values have been modified but feature and observation dimensions are the same.\tNormalization and Log2 transformation"
#> 
#> Slot "oid":
#> [1] "oid1"
#> 
#> Slot "fid":
#> [1] "fid1"
#> 
#> Slot "obs":
#> [1] "obs1"
#> 
#> Slot "fea":
#> [1] "fea1"
#> 
#> 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] "dense"
#> 
#> Slot "representation_description":
#> [1] "The matrix contains zeros for the majority of the measurements"
#> 
#> Slot "obs_unit":
#> [1] "cell"
#> 
#> Slot "obs_unit_description":
#> [1] "Features are quantified for individual cells, ex: Single-cell RNA-seq"
#> 
#> Slot "processing":
#> [1] "counts"
#> 
#> Slot "processing_description":
#> [1] "Raw data for assays that produce integer-like data such as scRNA-seq.Child of raw"
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] " Used for technologies that measure RNA expression levels.This should generally be used for assays listed under “RNA assay” (EFO_0001457) from the OLS.\n                    dna\tUsed for technologies that measure features of DNA.\tThis should generally be used for assays listed under “DNA assay” (EFO_0001456) from the OLS."
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] "subset"
#> 
#> Slot "obs_subset_description":
#> [1] "Observations that belong to a certain biological subcategory"
#> 
#> Slot "feature_subset":
#> [1] "full"
#> 
#> Slot "feature_subset_description":
#> [1] "Features have not been filtered or subsetted."
#> 
#> Slot "record_id":
#> [1] "Seurat.subset"
#> 
#> Slot "parent_id":
#> [1] "fom1"
#> 
#> Slot "parent_relationship":
#> [1] "Parent"
#> 
#> Slot "parent_relationship_description":
#> [1] "This is the parent_matrix"
#> 
#> Slot "oid":
#> [1] "oid2"
#> 
#> Slot "fid":
#> [1] "fid2"
#> 
#> Slot "obs":
#> [1] "obs2"
#> 
#> Slot "fea":
#> [1] "fea2"
#> 
#> 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] "dense"
#> 
#> Slot "representation_description":
#> [1] "The matrix contains non-zeros for the majority of the measurements"
#> 
#> Slot "obs_unit":
#> [1] "cell"
#> 
#> Slot "obs_unit_description":
#> [1] "Features are quantified for individual cells, ex: Single-cell RNA-seq"
#> 
#> Slot "processing":
#> [1] "logNormalize"
#> 
#> Slot "processing_description":
#> NULL
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] " Used for technologies that measure RNA expression levels.This should generally be used for assays listed under “RNA assay” (EFO_0001457) from the OLS.\n                    dna\tUsed for technologies that measure features of DNA.\tThis should generally be used for assays listed under “DNA assay” (EFO_0001456) from the OLS."
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] "subset"
#> 
#> Slot "obs_subset_description":
#> [1] "Observations that belong to a certain biological subcategory"
#> 
#> Slot "feature_subset":
#> [1] "full"
#> 
#> Slot "feature_subset_description":
#> [1] "Features have not been filtered or subsetted."
#> 
#> Slot "record_id":
#> [1] "NormalizeData.rna"
#> 
#> Slot "parent_id":
#> [1] "fom4"
#> 
#> Slot "parent_relationship":
#> [1] "transformation"
#> 
#> Slot "parent_relationship_description":
#> [1] "Values have been modified but feature and observation dimensions are the same.\tNormalization and Log2 transformation"
#> 
#> Slot "oid":
#> [1] "oid2"
#> 
#> Slot "fid":
#> [1] "fid2"
#> 
#> Slot "obs":
#> [1] "obs2"
#> 
#> Slot "fea":
#> [1] "fea2"
#> 
#> 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] "dense"
#> 
#> Slot "representation_description":
#> [1] "The matrix contains non-zeros for the majority of the measurements"
#> 
#> Slot "obs_unit":
#> [1] "cell"
#> 
#> Slot "obs_unit_description":
#> [1] "Features are quantified for individual cells, ex: Single-cell RNA-seq"
#> 
#> Slot "processing":
#> [1] "scaled"
#> 
#> Slot "processing_description":
#> [1] "Data with features have been centered around a standard quantity and standardized to have similar variances or ranges.\tZ-scored data"
#> 
#> Slot "analyte":
#> [1] "rna"
#> 
#> Slot "analyte_description":
#> [1] " Used for technologies that measure RNA expression levels.This should generally be used for assays listed under “RNA assay” (EFO_0001457) from the OLS.\n                    dna\tUsed for technologies that measure features of DNA.\tThis should generally be used for assays listed under “DNA assay” (EFO_0001456) from the OLS."
#> 
#> Slot "modality":
#> [1] "rna"
#> 
#> Slot "obs_subset":
#> [1] "subset"
#> 
#> Slot "obs_subset_description":
#> [1] "Observations that belong to a certain biological subcategory"
#> 
#> Slot "feature_subset":
#> [1] "variable"
#> 
#> Slot "feature_subset_description":
#> [1] "Features that have minimum level of variability across all cells"
#> 
#> Slot "record_id":
#> [1] "ScaleData.rna"
#> 
#> Slot "parent_id":
#> [1] "fom5"
#> 
#> Slot "parent_relationship":
#> [1] "transformation"
#> 
#> Slot "parent_relationship_description":
#> [1] "Values have been modified but feature and observation dimensions are the same.\tNormalization and Log2 transformation"
#> 
#> Slot "oid":
#> [1] "oid2"
#> 
#> Slot "fid":
#> [1] "fid2"
#> 
#> Slot "obs":
#> [1] "obs2"
#> 
#> Slot "fea":
#> [1] "fea2"
#> 
#> Slot "ong":
#> [1] NA
#> 
#> Slot "fng":
#> [1] NA
#> 
#> 
#> 
#> Slot "FEA":
#> $fea1
#> An object of class "FEA"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "srt.rds"
#> 
#> Slot "accessor":
#> [1] "`srt[[counts]][[]]`"
#> 
#> Slot "feature_modality":
#> [1] "rna"
#> 
#> Slot "reference_database":
#> [1] NA
#> 
#> Slot "reference_organism":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> 
#> $fea2
#> An object of class "FEA"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "subset_srt.rds"
#> 
#> Slot "accessor":
#> [1] "`subset_srt[[counts]][[]]`"
#> 
#> Slot "feature_modality":
#> [1] "rna"
#> 
#> Slot "reference_database":
#> [1] NA
#> 
#> Slot "reference_organism":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> 
#> 
#> Slot "OBS":
#> $obs1
#> An object of class "OBS"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "srt.rds"
#> 
#> Slot "accessor":
#> [1] "srt[[]]"
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> 
#> $obs2
#> An object of class "OBS"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "subset_srt.rds"
#> 
#> Slot "accessor":
#> [1] "subset_srt[[]]"
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> 
#> 
#> Slot "FID":
#> $fid1
#> An object of class "FID"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = srt, slot = \"counts\" assay = \"RNA\")"
#> 
#> 
#> $fid2
#> An object of class "FID"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "subset_srt.rds"
#> 
#> Slot "accessor":
#> [1] "GetAssayData(object = subset_srt, slot = \"counts\" assay = \"RNA\")"
#> 
#> 
#> 
#> Slot "OID":
#> $oid1
#> An object of class "OID"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "srt.rds"
#> 
#> Slot "accessor":
#> [1] "`colnames(srt)`"
#> 
#> 
#> $oid2
#> An object of class "OID"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "filepath":
#> [1] "subset_srt.rds"
#> 
#> Slot "accessor":
#> [1] "`colnames(subset_srt)`"
#> 
#> 
#> 
#> Slot "REC":
#> $CellRanger.count
#> An object of class "REC"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "record_package_name":
#> [1] "CellRanger"
#> 
#> Slot "record_package_version":
#> [1] "unknown"
#> 
#> Slot "record_function_name":
#> [1] "count"
#> 
#> Slot "record_function_parameters":
#> [1] NA
#> 
#> Slot "record_workflow_link":
#> [1] NA
#> 
#> Slot "record_runtime_start":
#> [1] NA
#> 
#> Slot "record_runtime_end":
#> [1] NA
#> 
#> Slot "record_runtime_duration":
#> [1] NA
#> 
#> 
#> $NormalizeData.rna
#> An object of class "REC"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "record_package_name":
#> [1] "Seurat"
#> 
#> Slot "record_package_version":
#> [1] "5.0.2"
#> 
#> Slot "record_function_name":
#> [1] "NormalizeData"
#> 
#> Slot "record_function_parameters":
#> [[1]]
#> NULL
#> 
#> 
#> Slot "record_workflow_link":
#> [1] NA
#> 
#> Slot "record_runtime_start":
#> [1] NA
#> 
#> Slot "record_runtime_end":
#> [1] NA
#> 
#> Slot "record_runtime_duration":
#> [1] NA
#> 
#> 
#> $ScaleData.rna
#> An object of class "REC"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "record_package_name":
#> [1] "Seurat"
#> 
#> Slot "record_package_version":
#> [1] "5.0.2"
#> 
#> Slot "record_function_name":
#> [1] "ScaleData"
#> 
#> Slot "record_function_parameters":
#> [[1]]
#> NULL
#> 
#> 
#> Slot "record_workflow_link":
#> [1] NA
#> 
#> Slot "record_runtime_start":
#> [1] NA
#> 
#> Slot "record_runtime_end":
#> [1] NA
#> 
#> Slot "record_runtime_duration":
#> [1] NA
#> 
#> 
#> $Seurat.subset
#> An object of class "REC"
#> Slot "id":
#> [1] NA
#> 
#> Slot "dataset_id":
#> [1] NA
#> 
#> Slot "record_id":
#> [1] NA
#> 
#> Slot "record_package_name":
#> [1] "Seurat"
#> 
#> Slot "record_package_version":
#> [1] "5.0.2"
#> 
#> Slot "record_function_name":
#> [1] "subset"
#> 
#> Slot "record_function_parameters":
#> [1] NA
#> 
#> Slot "record_workflow_link":
#> [1] NA
#> 
#> Slot "record_runtime_start":
#> [1] NA
#> 
#> Slot "record_runtime_end":
#> [1] NA
#> 
#> Slot "record_runtime_duration":
#> [1] NA
#> 
#> 
#> 
#> Slot "ONG":
#> list()
#> 
#> Slot "FNG":
#> list()
#>