sampleNames

Class: bioma.data.ExptData
Package: bioma.data

Retrieve or set sample names in ExptData object

Syntax

SamNames = sampleNames(EDObj)
SamNames = sampleNames(EDObj, Subset)
NewEDObj = sampleNames(EDObj, Subset, NewSamNames)

Description

SamNames = sampleNames(EDObj) returns a cell array of strings specifying all sample names in an ExptData object.

SamNames = sampleNames(EDObj, Subset) returns a cell array of strings specifying a subset the sample names in an ExptData object.

NewEDObj = sampleNames(EDObj, Subset, NewSamNames) replaces the sample names specified by Subset in EDObj, an ExptData object, with NewSamNames, and returns NewEDObj, a new ExptData object.

Input Arguments

EDObj

Object of the bioma.data.ExptData class.

Subset

One of the following to specify a subset of the sample names in an ExptData object:

  • String specifying a sample name

  • Cell array of strings specifying sample names

  • Positive integer

  • Vector of positive integers

  • Logical vector

NewSamNames

New sample names for specific sample names within an ExptData object, specified by one of the following:

  • Numeric vector

  • String or cell array of strings

  • String, which sampleNames uses as a prefix for the sample names, with sample numbers appended to the prefix

  • Logical true or false (default). If true, sampleNames assigns unique sample names using the format Sample1, Sample2, etc.

The number of sample names in NewSamNames must equal the number of samples specified by Subset.

Output Arguments

SamNames

Cell array of strings specifying all or some of the sample names in an ExptData object. The sample names are the column names in the DataMatrix objects in the ExptData object.

NewEDObj

Object of the bioma.data.ExptData class, returned after replacing specific sample names.

Examples

Construct an ExptData object, and then retrieve the sample names from it:

% Import bioma.data package to make constructor functions
% available
import bioma.data.*
% Create DataMatrix object from .txt file containing 
% expression values from microarray experiment
dmObj = DataMatrix('File', 'mouseExprsData.txt');
% Construct ExptData object
EDObj = ExptData(dmObj);
% Retrieve sample names
SNames = sampleNames(EDObj);
Was this topic helpful?