Main Content

elementNames

Class: bioma.data.ExptData
Namespace: bioma.data

Retrieve or set element names of DataMatrix objects in ExptData object

Syntax

ElmtNames = elementNames(EDObj)
ElmtNames = elementNames(EDObj, Subset)
NewEDObj = elementNames(EDObj, Subset, NewElmtNames)

Description

ElmtNames = elementNames(EDObj) returns a cell array of character vectors specifying the element names of all the data elements (DataMatrix objects) stored in an ExptData object.

ElmtNames = elementNames(EDObj, Subset) returns a cell array of character vectors specifying the element names of a subset of the data elements (DataMatrix objects) stored in an ExptData object.

NewEDObj = elementNames(EDObj, Subset, NewElmtNames) replaces the element names of the data elements (DataMatrix objects) specified by Subset in EDObj, an ExptData object, with NewElmtNames, and returns NewEDObj, a new ExptData object.

Input Arguments

EDObj

Object of the bioma.data.ExptData class.

Subset

One of the following to specify the element names of a subset of the data elements (DataMatrix objects) in an ExptData object:

  • Character vector specifying an element name

  • Cell array of character vectors specifying element names

  • Positive integer

  • Vector of positive integers

  • Logical vector

NewElmtNames

New element names for specific data elements (DataMatrix objects) within an ExptData object, specified by one of the following:

  • Numeric vector

  • Character vector or cell array of character vectors

  • Character vector, which elementNames uses as a prefix for the element names, with element numbers appended to the prefix

  • Logical true or false (default). If true, elementNames assigns unique element names using the format Elmt1, Elmt2, etc.

The number of elements in NewElmtNames must equal the number of elements specified by Subset.

Output Arguments

ElmtNames

Cell array of character vectors specifying the element names of all or some of the data elements (DataMatrix objects) in an ExptData object.

NewEDObj

Object of the bioma.data.ExptData class, returned after replacing element names of specific data elements (DataMatrix objects).

Examples

Construct an ExptData object, and then retrieve the element names of DataMatrix objects from it:

% Import the bioma.data namespace 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 element names of DataMatrix objects
ENames = elementNames(EDObj);