createTomo: Create an object representing tomo-seq data

createTomoR Documentation

Create an object representing tomo-seq data

Description

This is a generic function to create an object representing tomo-seq data. The input object can either be a matrix or a SummarizeExperiment.

Usage

createTomo(object, ...)

## S4 method for signature 'SummarizedExperiment'
createTomo(
  object,
  min.section = 3,
  normalize = TRUE,
  normalize.method = "median",
  scale = TRUE
)

## S4 method for signature 'matrix'
createTomo(
  object,
  matrix.normalized = NULL,
  min.section = 3,
  normalize = TRUE,
  normalize.method = "median",
  scale = TRUE
)

## S4 method for signature 'missing'
createTomo(
  matrix.normalized = NULL,
  min.section = 3,
  normalize = TRUE,
  normalize.method = "median",
  scale = TRUE,
  ...
)

Arguments

object

Either a raw read count matrix or a SummarizedExperiment object.

...

Additional parameters to pass to S4 methods.

min.section

Integer. Genes expressed in less than min.section sections will be filtered out.

normalize

Logical, whether to perform normalization when creating the object. Default is TRUE.

normalize.method

Character, must be one of "median", or "cpm".

scale

Logical, whether to perform scaling when creating the object. Default is TRUE.

matrix.normalized

(Optional) A numeric matrix of normalized read count.

Details

This is the generic function to create a SummarizedExperiment object for representing tomo-seq data. Either matrix or SummarizedExperiment object can be used for input.

When using matrix for input, at least one of raw read count matrix and normalized read count matrix (like FPKM and TPM) must be used for input. If normalized matrix is available, input it with argument matrix.normalized. Matrices should have genes as rows and sections as columns. Columns should be sorted according to the order of sections.

When using SummarizedExperiment object for input, it must contain at least one of 'count' assay and 'normalized' assay. Besides, the row data and column data of the input object will be retained in the output object.

By default, all library sizes are normalized to the median library size across sections. Set normalize.method = "cpm" will make library sizes normalized to 1 million counts. Scaling and centering is performed for all genes across sections.

Value

A SummarizedExperiment object. Raw read count matrix, normalized read count matrix and scaled read count matrix are saved in 'count', 'normalized' and 'scale' assays of the object.

See Also

  • tomoMatrix : creating an object from matrix.

  • tomoSummarizedExperiment : creating an object from SummarizedExperiment.

  • normalizeTomo : normalization.

  • scaleTomo : scaling.

  • SummarizedExperiment-class : operations on SummarizedExperiment.

Examples

data(zh.data)
zh <- createTomo(zh.data)

data(zh.data)
se <- SummarizedExperiment::SummarizedExperiment(assays=list(count=zh.data))
zh <- createTomo(se)

liuwd15/tomoda documentation built on March 29, 2022, 1:09 a.m.