Utility function that prepares metadata to be slotted into colData().

makeSampleData(object, ...)

# S4 method for data.frame
makeSampleData(object)

# S4 method for DataFrame
makeSampleData(object)

Arguments

object

Object.

...

Additional arguments.

Value

DataFrame.

Details

This function adheres to the following conventions:

  • Row names are required. Either define manually (recommended) or pass in as a rownames column (data.table / tibble style). Supported colnames: "sampleID", "rowname", "rn".

  • All column names will be converted to lower camel case (see camelCase() for details).

  • sampleName column is always placed first.

Required columns:

  • sampleName: Human readable sample names. Note that this column is useful for plots and doesn't have to match the column names of a SummarizedExperiment object, which should use valid names.

Blacklisted columns:

  • filename (use fileName).

  • id.

  • interestingGroups. Defined automatically downstream.

  • sample. Too vague. Does this represent an ID or human readable name?

  • samplename (use sampleName).

Note

Updated 2019-10-10.

See also

makeNames.

Examples

object <- DataFrame( genotype = rep(c("control", "wildtype"), times = 2L), treatment = rep(c("vector", "RNAi"), each = 2L), sampleName = paste("sample", seq_len(4L)), row.names = paste0("GSM000000", seq_len(4L)) ) makeSampleData(object)
#> DataFrame with 4 rows and 3 columns #> sampleName genotype treatment #> <factor> <factor> <factor> #> GSM0000001 sample 1 control vector #> GSM0000002 sample 2 wildtype vector #> GSM0000003 sample 3 control RNAi #> GSM0000004 sample 4 wildtype RNAi