Main Content

variableValues

Retrieve or set variable values for samples in MetaData object

Syntax

DSVarValues = variableValues(MDObj)
NewMDObj = variableValues(MDObj, NewDSVarValues)

Description

DSVarValues = variableValues(MDObj) returns a dataset array containing the measured value of each variable per sample from a MetaData object.

NewMDObj = variableValues(MDObj, NewDSVarValues) replaces the sample variable values in MDObj, a MetaData object, with NewDSVarValues, and returns NewMDObj, a new MetaData object.

Input Arguments

MDObj

Object of the bioma.data.MetaData class.

NewDSVarValues

A new dataset array containing a value for each variable per sample. In this dataset array, the columns correspond to variables and rows correspond to samples. The row names (sample names) must match the row names (sample names) in DSVarValues, the dataset array being replaced in the MetaData object, MDObj.

Output Arguments

DSVarValues

A dataset array containing the measured value of each variable per sample from a MetaData object. In this dataset array, the columns correspond to variables and rows correspond to samples.

NewMDObj

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

Examples

Construct a MetaData object, and then retrieve the sample variable values 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 values
VarValues = variableValues(MDObj2)