ScandalDataSet: ScandalDataSet class

Description Usage Arguments Details Slots Constructor Methods Author(s) See Also Examples

View source: R/AllClasses.R

Description

An S4 class for storing single-cell seqeuncing data, reduced dimensions representations of the data reuqired in the analysis process such as t-SNE and UMAP coordinates and the end-product of the analysis which are the transcriptional programs.

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## Constructor
ScandalDataSet(..., preprocConfig = DefaultPreprocConfig(),
  nodeID = NODE_ID(), projectID = PROJ_ID())

## S4 method for signature 'ScandalDataSet'
logtpm(object, ...)

## S4 replacement method for signature 'ScandalDataSet'
logtpm(object, ...) <- value

## S4 method for signature 'ScandalDataSet'
qualityControl(object)

## S4 replacement method for signature 'ScandalDataSet'
qualityControl(object) <- value

## S4 method for signature 'ScandalDataSet'
nodeID(object)

## S4 replacement method for signature 'ScandalDataSet'
nodeID(object) <- value

## S4 method for signature 'ScandalDataSet'
projectID(object)

## S4 method for signature 'ScandalDataSet'
sampleIDs(object)

## S4 method for signature 'ScandalDataSet'
unprocessedData(object)

## S4 method for signature 'ScandalDataSet'
preprocConfig(object)

## S4 method for signature 'ScandalDataSet'
cell2SampleMap(object)

## S4 method for signature 'ScandalDataSet'
inspectSamples(object, sampleIDs, nodeID = NODE_ID())

## S4 method for signature 'ScandalDataSet'
show(object)

Arguments

...

arguments to pass to the SingleCellExperiment constructor.

preprocConfig

a configuration object of class PreprocConfig

nodeID

a unique identifier of the constructed ScandalDataSet object that should represent the specific sample. If not supplied a unique ID will be generated randomly however it is advised to set this field.

projectID

an identifier common to all the nodes in the constructed ScandalDataSet object. If not supplied a unique ID will be generated randomly however it is advised to set this field.

cell2SampleMap

a **function** that maps a vector of cell IDs to a vector of sample IDs to which the cells belong. The default function assumes that the cell ID is a string separated by "-" and that the node ID is contained in the substring until the first "-" character.

object

a ScandalDataSet object.

value

a value to replace the currently set value (applies to all setter methods).

Details

The S4 class ScandalDataSet inherits from and extends Bioconductor's base class for single-cell related applications, the SingleCellExperiment class. The idea behind scandal is that in order to detect intra-tumor heterogeneity one needs inspect each tumor individually to collect the different transcriptomic programs that can be found within each tumor and then assess these programs at the level of the entire dataset to define the programs that generalize best (meta-programs). Besides the functionality supplied by its superclasses, ScandalDataSet supplies methods to keep

Slots

unprocessedData

A read-only matrix that contains the unprocessed data that allows re-accessing this data without the need to read it from file. Sparse matrix representation as well as maintaining a single copy for the entire objects tree decreases the memory overhead of this approach.

preprocConfig

A configuration object of class PreprocConfig.

qualityControl

A SimpleList object containing objects of class QCResults representing the quality control results, i.e. the cells and genes in each individual node that passed qaulity control and are available for downstream analysis.

nodeID

A unique character identifier of the constructed ScandalDataSet object that should represent the specific sample.

projectID

A character identifier common to all the nodes in the constructed ScandalDataSet object.

cell2SampleMap

A **function** that maps a vector of cell IDs to a vector of sample IDs to which the cells belong.

Constructor

Constructs a ScandalDataSet object.

Methods

logtpm

Getter/setter for the logtpm assay

unprocessedData

Getter for the unprocessedData (read-only)

preprocConfig

Getter for the preprocConfig (read-only)

qualityControl

Getter/Setter for the qualityControl list

nodeID

Getter/setter for the nodeID

projectID

Getter/setter for the projectID

sampleIDs

Returns a character vector containing the IDs of all samples in the dataset.

inspectSamples

Returns a ScandalDataSet object representing a set of specific samples.

cell2SampleMap

Getter for the cell2SampleMap function (read-only)

Author(s)

Avishay Spitzer

See Also

SummarizedExperiment, SingleCellExperiment, scandal_preprocess

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
# Building a mock dataset with 30 cells and 100 genes
ngenes <- 100
ncells <- 30
dataset <- matrix(sample(0:1e4, ngenes * ncells, replace = FALSE), nrow = ngenes, ncol = ncells)
rownames(dataset) <- sapply(seq_len(ngenes), function(x) paste0("GENE", x))
colnames(dataset) <- c(sapply(seq_len(ncells / 2), function(x) paste0("TUMOR1-Cell", x)),
                       sapply(seq(from = ncells / 2 + 1, to = ncells), function(x) paste0("TUMOR2-Cell", (x - ncells/2))))

# Declare a global confguration object for the top-level ScandalDataSet object and
# a named list of configuration objects for each single tumor. Note that the names
# of the elements in the named list correspond to the names of the tumors that appear
# in the column names
global_config <- PreprocConfig(complexityCutoff = c(0, 10000), expressionCutoff = 1, housekeepingCutoff = 1, logBase = 2, scalingFactor = 1, pseudoCount = 1, typeMatrix = TRUE)
tumor_config <- list(TUMOR1 = PreprocConfig(complexityCutoff = c(0, 10000), expressionCutoff = 1, housekeepingCutoff = 1, logBase = 2, scalingFactor = 1, pseudoCount = 1, typeMatrix = TRUE),
                     TUMOR2 = PreprocConfig(complexityCutoff = c(0, 10000), expressionCutoff = 1, housekeepingCutoff = 1, logBase = 2, scalingFactor = 1, pseudoCount = 1, typeMatrix = TRUE))

# Instantiate a new ScandalDataSet object
sds <- ScandalDataSet(assays = list(tpm = dataset), preprocConfig = global_config, nodeID = "Example1", projectID = "Project1")

sds # Prints a user-readable summary of sds

all(colnames(sds) == colnames(dataset)) # TRUE
all(rownames(sds) == rownames(dataset)) # TRUE
sampleIDs(sds) # Return a vector (TUMOR1, TUMOR2)
qualityControl(sds) # Empty list
nodeID(sds) # Returns "Example1"
projectID(sds) # Returns "Project1"

dravishays/scandal documentation built on Jan. 8, 2020, 1:30 p.m.