Documentation Center

  • Trial Software
  • Product Updates

bioma.data.MetaData class

Package: bioma.data

Contain metadata from microarray experiment

Description

The MetaData class is designed to contain metadata (variable values and descriptions) from a microarray experiment. It provides a convenient way to store related metadata in a single data structure (object). It also lets you manage and subset the data.

The metadata is a collection of variable names, for example related to samples or microarray features, along with descriptions and values for the variables. A MetaData object stores the metadata in two dataset arrays.

  • Values dataset array — A dataset array containing the measured value of each variable per sample or feature. In this dataset array, the columns correspond to variables and rows correspond to either samples or features. The number and names of the columns in this dataset array must match the number and names of the rows in the Descriptions dataset array. If this dataset array contains sample metadata, then the number and names of the rows (samples) must match the number and names of the columns in the DataMatrix objects in the same ExpressionSet object. If this dataset array contains feature metadata, then the number and names of the rows (features) must match the number and names of the rows in the DataMatrix objects in the same ExpressionSet object.

  • Descriptions dataset array — A dataset array containing a list of the variable names and their descriptions. In this dataset array, each row corresponds to a variable. The row names are the variable names, and a column, named VariableDescription, contains a description of the variable. The number and names of the rows in the Descriptions dataset array must match the number and names of the columns in the Values dataset array.

The MetaData class includes properties and methods that let you access, retrieve, and change metadata variables, and their values and descriptions. These properties and methods are useful to view and analyze the metadata.

Construction

MDobj = bioma.data.MetaData(VarValues) creates a MetaData object from one dataset array whose rows correspond to sample (observation) names and whose columns correspond to variables. The dataset array contains the measured value of each variable per sample.

MDobj = bioma.data.MetaData(VarValues, VarDescriptions) creates a MetaData object from two dataset arrays. VarDescriptions is a dataset array whose rows correspond to variables. The row names are the variable names, and another column, named VariableDescription, contains a description of each variable.

MDobj = bioma.data.MetaData(VarValues, VarDesc) creates a MetaData object from a dataset array and VarDesc a cell array of strings containing descriptions of the variables.

MDobj = bioma.data.MetaData(..., 'PropertyName', PropertyValue) constructs the object using options, specified as property name/property value pairs.

MDobj = bioma.data.MetaData('File', FileValue) creates a MetaData object from a text file containing a table of metadata. The table row labels must be sample names, and its column headers must be variable names.

MDobj = bioma.data.MetaData('File', FileValue, ...'Path', PathValue) specifies a folder or path and folder where FileValue is stored.

MDobj = bioma.data.MetaData('File', FileValue, ...'Delimiter', DelimiterValue) specifies a delimiter symbol to use as a column separator for FileValue. Default is '\t'.

MDobj = bioma.data.MetaData('File', FileValue, ...'RowNames', RowNamesValue) specifies the row names (sample names) for the MetaData object. Default is the information in the first column of the table.

MDobj = bioma.data.MetaData('File', FileValue, ...'ColumnNames', ColumnNamesValue) specifies the columns of data to read from the table. ColumnNamesValue is a cell array of strings specifying the column header names. Default is to read all columns of data from the table, assuming the first row contains column headers.

MDobj = bioma.data.MetaData('File', FileValue, ...'VarDescChar', VarDescCharValue) specifies that lines in the table prefixed by VarDescCharValue to be read as descriptions and used to create the VarDescriptions dataset array. By default, bioma.data.MetaData does not read variable description information, and does not create a Descriptions dataset array. These prefixed lines must appear at the top of the file, before the table of metadata values.

MDobj = bioma.data.MetaData(...'Name', NameValue) specifies a name for the MetaData object.

MDobj = bioma.data.MetaData('File', FileValue, ...'Description', DescriptionValue) specifies a description for the MetaData object.

MDobj = bioma.data.MetaData('File', FileValue, ...'SampleNames', SampleNamesValue) specifies sample names (row names) for the MetaData object.

MDobj = bioma.data.MetaData('File', FileValue, ...'VariableNames', VariableNamesValue) specifies variable names (column names) for the MetaData object.

Input Arguments

VarValues

Dataset array whose rows correspond to sample (observation) names and whose columns correspond to variables. The dataset array contains the measured value of each variable per sample or feature.

The number and names of the columns in the VarValues dataset array must match the number and names of the rows in the VarDescriptions dataset array. If VarValues contains sample metadata, then the number and names of the rows (samples) must match the number and names of the columns in the DataMatrix objects in the same ExpressionSet object. If VarValues contains feature metadata, then the number and names of the rows (features) must match the number and names of the rows in the DataMatrix objects in the same ExpressionSet object.

VarDescriptions

Dataset array whose rows correspond to variables. The row names are the variable names, and a column, named VariableDescription, contains a description of the variable. The number and names of the rows in the VarDescriptions dataset array must match the number and names of the columns in the VarValues dataset array.

VarDesc

Cell array of strings containing descriptions of the variables. The number of elements in VarDesc must equal the number of columns (variable names) in VarValues.

FileValue

String specifying a text file containing a table of metadata. The table row labels must be sample or feature names, and its column headers must be variable names. The text file must be on the MATLAB search path or in the Current Folder (unless you use the Path property).

PathValue

String specifying a folder or path and folder where FileValue is stored.

DelimiterValue

String specifying a delimiter symbol to use as a column separator for FileValue. Typical choices are:

  • ' '

  • '\t' (default)

  • ','

  • ';'

  • '|'

RowNamesValue

Row names (sample or feature names) for the MetaData object, specified by one of the following:

  • Cell array of strings

  • Single number indicating the column of the table containing the row names

  • Character string indicating the column header of the table containing the row names

If you specify [] for RowNamesValue, then bioma.data.MetaData provides numbered row names, starting with 1.

Default: 1, which specifies the information in the first column of the table

ColumnNamesValue

Cell array of strings specifying the column header names to indicate which columns of data to read from the table. Default is to read all columns of data from the table, assuming the first row contains column headers. If the table does not have column headers, specify [] for ColumnNamesValue to read all columns of data and provide numbered column names, starting with 1.

VarDescCharValue

String specifying a character to prefix lines in the table that are to be read as descriptions and used to create the VarDescriptions dataset array. By default, bioma.data.MetaData does not read variable description information, and does not create a VarDescriptions dataset array. These prefixed lines must appear at the top of the file, before the table of metadata values.

NameValue

String specifying a name for the MetaData object.

DescriptionValue

String specifying a description for the MetaData object.

SampleNamesValue

Cell array of strings specifying sample names for the MetaData object. The number of elements in the cell array must equal the number of samples in the MetaData object. This input overwrites sample names from the input file. Default are the sample names (row names) from the input file.

VariableNamesValue

Cell array of strings specifying variable names for the MetaData object. The number of elements in the cell array must equal the number of variables in the MetaData object. This input overwrites variable names from the input file. Default are the variable names (column names) from the input file.

Properties

Description

Description of the MetaData object.

String specifying a description of the MetaData object. Default is [].

DimensionLabels

Row and column labels for the MetaData object.

Two-element cell array containing strings specifying labels of the rows and columns respectively in the MetaData object. Default is {'Samples', 'Variables'}.

Name

Name of the MetaData object.

String specifying the name of the MetaData object. Default is [].

NSamples

Number of samples (observations) in the experiment

Positive integer specifying the number of samples in the experiment. This value is equivalent to the number of rows in the VarValues dataset array. This information is read-only

Attributes:

SetAccessprivate

NVariables

Number of variables in the experiment

Positive integer specifying the number of variables in the experiment. This value is equivalent to the number of columns in the VarValues dataset array. This information is read-only

Attributes:

SetAccessprivate

Methods

combineCombine two MetaData objects
isemptyDetermine whether MetaData object is empty
sampleNamesRetrieve or set sample names in MetaData object
sizeReturn size of MetaData object
variableDescRetrieve or set variable descriptions for samples in MetaData object
variableNamesRetrieve or set variable names for samples in MetaData object
variableValuesRetrieve or set variable values for samples in MetaData object
varValuesTableCreate 2-D graphic table GUI of variable values in MetaData object

Instance Hierarchy

An ExpressionSet object contains two MetaData objects, one for sample information and one for microarray feature information. A MetaData object contains two dataset arrays. One dataset array contains the measured value of each variable per sample or feature. The other dataset array contains a list of the variable names and their descriptions.

Attributes

To learn about attributes of classes, see Class Attributes in the MATLAB® Object-Oriented Programming documentation.

Copy Semantics

Value. To learn how this affects your use of the class, see Copying Objects in the MATLAB Programming Fundamentals documentation.

Indexing

MetaData objects support 2-D parenthesis ( ) indexing and dot . indexing to extract, assign, and delete data.

MetaData objects do not support:

  • Curly brace { } indexing

  • Linear indexing

Examples

Construct a MetaData object containing sample variable information from a text file:

% Import bioma.data package to make constructor function
% available
import bioma.data.*
% Construct MetaData object from .txt file
MDObj2 = MetaData('File', 'mouseSampleData.txt', 'VarDescChar', '#');
% Display information about the MetaData object
MDObj2
% Supply a description for the MetaData object
MDObj2.Description = 'This MetaData Object contains sample variable info.'

See Also

| |

Tutorials

How To

Was this topic helpful?