EzDataset-class: The R5 class representing a dataset

EzDataset-classR Documentation

The R5 class representing a dataset

Description

Use this to create an object of the class EzDataset that contains the necessary fields for the input and output datasets.

Fields

file

a character representing the file path of the dataset's contents.

meta

a data.frame containing the information about the samples.

colNames

a character vector of the column names in meta.

tags

a list with possible tags for colNames.

isModified

whether the dataset has been modified.

Methods

columnHasTag(tag)

Checks each column whether its tags matches tag.

getColumn(names)

Gets the column(s) selected with names.

getFullPaths(name)

Gets the files in the nameed column prepended with the dataRoot.

getLength()

Gets the number of samples.

getNames()

Gets the row names.

setColumn(name, values)

Sets the column selected with name to values. If values is NULL the column gets removed

subset(samples)

Subsets the meta field keeping samples and generates a new EzDataset

Functions

  • ezTagListFromNames(names): Gets the tags from names that are in the format [tag].

Author(s)

Rehrauer, Hubert

Schmid, Peter

Examples

file = system.file("extdata/yeast_10k/dataset.tsv", package="ezRun", mustWork = TRUE)
dataRoot = system.file(package="ezRun", mustWork = TRUE)
ds = EzDataset$new(file=file, dataRoot=dataRoot)
ds$file
ds$meta
ds$getColumn("Read1")
ds$getFullPaths("Read1")
ds2 = ds$copy()
ds2$setColumn("Read1","replacement")
ds$columnHasTag("File")
ds$getNames()
ds$meta$"Genotype [Factor]"[1] = "a"
ds2 = EzDataset$new(meta = ds$meta, dataRoot=dataRoot)

uzh/ezRun documentation built on Dec. 26, 2024, 9:53 a.m.