Main Content

variableDesc

Retrieve or set variable descriptions for samples in MetaData object

Syntax

DSVarDescriptions = variableDesc(MDObj)
NewMDObj = variableDesc(MDObj, NewDSVarDescriptions)

Description

DSVarDescriptions = variableDesc(MDObj) returns a dataset array containing the variable names and descriptions for samples from a MetaData object.

NewMDObj = variableDesc(MDObj, NewDSVarDescriptions) replaces the sample variable descriptions in MDObj, a MetaData object, with NewDSVarDescriptions, and returns NewMDObj, a new MetaData object.

Input Arguments

MDObj

Object of the bioma.data.MetaData class.

NewDSVarDescriptions

Descriptions of the sample variable names, specified by one of the following:

  • A new dataset array containing the variable names and descriptions for samples. In this dataset array, each row corresponds to a variable. The first column contains the variable name, and the second column (VariableDescription) contains a description of the variable. The row names (variable names) must match the row names (variable names) in DSVarDescriptions, the dataset array being replaced in the MetaData object, MDObj.

  • Cell array of character vectors containing descriptions of the variables. The number of elements in VarDesc must equal the number of row names (variable names) in DSVarDescriptions, the dataset array being replaced in the MetaData object, MDObj.

Output Arguments

DSVarDescriptions

A dataset array containing the variable names and descriptions from a MetaData object. In this dataset array, each row corresponds to a sample variable. The first column contains the variable name, and the second column (VariableDescription) contains a description of the variable.

NewMDObj

Object of the bioma.data.MetaData class, returned after replacing the dataset array containing the sample variable descriptions.

Examples

Construct a MetaData object, and then retrieve the sample variable descriptions from it:

% Import the bioma.data namespace to make constructor function
% available
import bioma.data.*
% Construct MetaData object from .txt file
MDObj2 = MetaData('File', 'mouseSampleData.txt', 'VarDescChar', '#');
% Retrieve the sample variable descriptions
VarDescriptions = variableDesc(MDObj2)