sampleData: Sample data

sampleDataR Documentation

Sample data

Description

Metadata that describes the samples.

Usage

sampleData(object, ...)

sampleData(object, ...) <- value

## S4 method for signature 'SummarizedExperiment'
sampleData(
  object,
  clean = TRUE,
  ignoreCols = c("^description$", "^genomeBuild$", "^qualityFormat$", "^samRef$")
)

## S4 replacement method for signature 'SummarizedExperiment,DFrame'
sampleData(object) <- value

## S4 method for signature 'SummarizedExperiment'
sampleNames(object)

Arguments

object

Object.

clean

logical(1). Only return factor columns. Useful when working with objects that contain quality control metrics in colData(). For example, bcbioRNASeq and DESeqDataSet objects often contain additional columns that aren't informative sample metadata.

ignoreCols

character or NULL. Only applies when clean = TRUE. Additional factor columns defined in colData to be ignored as sample-level metadata. Particularly useful for SingleCellExperiment objects, where cell-to-sample mappings are defined using the sampleId column.

value

Value to assign.

...

Additional arguments.

Details

All columns defined in colData of the object must be named in strict lower camel case, otherwise this function will intentionally error.

Value

DataFrame.

All supported S4 classes

Illegal colData:

  • interestingGroups: Generated automatically, based on the criteria slotted into the object using interestingGroups(). The function will error intentionally if this column is manually defined in colData().

Recommended colData:

  • sampleName: Human readable sample names used by basejump plotting functions in favor of object column names, which should be syntactically valid (but not always very readable). See make.names() for more information on syntactically valid names. Note that if this column is not defined in the object, it will be returned automatically by sampleData().

SummarizedExperiment

Required colData:

  • None.

Illegal colData:

  • sampleId: Redundant; already defined in the object column names.

Note

Updated 2021-02-22.

Examples

data(RangedSummarizedExperiment, package = "AcidTest")

## SummarizedExperiment ====
object <- RangedSummarizedExperiment
sampleData(object)

## Assignment support.
sampleData(object)[["batch"]] <- 1L
## `batch` column should be now defined.
sampleData(object)

acidgenomics/r-acidexperiment documentation built on Jan. 17, 2024, 7:56 p.m.