Skip to Main Content Skip to Search
Product Documentation

DataMatrix - Create DataMatrix object

Syntax

DMobj = DataMatrix(Matrix)
DMobj = DataMatrix(Matrix, RowNames, ColumnNames)
DMobj = DataMatrix('File', FileName)

DMobj = DataMatrix(..., 'RowNames', RowNamesValue, ...)
DMobj = DataMatrix(..., 'ColNames', ColNamesValue, ...)
DMobj = DataMatrix(..., 'Name', NameValue, ...)
DMobj = DataMatrix('File', FileName, ...'Delimiter', DelimiterValue, ...)
DMobj = DataMatrix('File', FileName, ...'HLine', HLineValue, ...)
DMobj = DataMatrix('File', FileName, ...'Rows', RowsValue, ...)
DMobj = DataMatrix('File', FileName, ...'Columns', ColumnsValue, ...)

Arguments

Matrix

Two-dimensional numeric or logical array.

RowNames

Row names for the DataMatrix object, specified by a numeric vector, character array, or cell array of strings, whose elements are equal in number to the number of rows in Matrix. RowNames are typically gene names or probe identifiers from a microarray experiment.

    Note   The row names do not need to be unique.

ColumnNames

Column names for the DataMatrix object, specified by a numeric vector, character array, or cell array of strings, whose elements are equal in number to the number of columns in Matrix. ColumnNames are typically sample identifiers from a microarray experiment.

    Note   The column names do not need to be unique.

FileName

String specifying a file name or a path and file name of a tab-delimited TXT or XLS file that contains table-oriented data and metadata.

    Note   Typically, the first row of the table contains column names, the first column contains row names, and the numeric data starts at the 2,2 position. The DataMatrix function will detect if the first column does not contain row names, and read data from the first column. However, if the first row does not contain header text (column names), set the HLine property to 0.

RowNamesValue, ColNamesValue

Row names or column names for the DataMatrix object. Choices are:

  • Numeric vector, character array, or a cell array of strings, whose elements are equal in number to the number of rows or number of columns of numeric data in the input matrix.

  • A single string, which is used as a prefix for row or column names. Numbers will be appended to the prefix.

  • true — Unique row or column names will be assigned using the formats row1, row2, row3, etc., or col1, col2, col3, etc.

  • false — Default. No row or column names are assigned.

    Note   The row or column names do not need to be unique.

NameValue

String specifying a name for the DataMatrix object. Default is ''.

DelimiterValue

String specifying a delimiter symbol to use for the input file. Typical choices are:

  • ' '

  • '\t' (default)

  • ','

  • ';'

  • '|'

HLineValue

Positive integer that specifies which row of the input file contains the column header text (column names). Default is 1.

When creating the DataMatrix object DMobj, the DataMatrix function loads data from (HLineValue + 1) to the end of the file.

    Tip   If the input file does not contain column header text (column names), set HLineValue to 0.

RowsValue, ColumnsValue

A subset of rows or columns in File, for the DataMatrix function to use to create the DataMatrix object. Choices are:

  • Cell array of strings

  • Character array

  • Numeric or logical vector

Description

A DataMatrix object encapsulates measurement data and feature metadata from a microarray experiment so that it can be indexed by gene names or probe identifiers and by sample identifiers. For examples of creating and using DataMatrix objects, see Representing Expression Data Values in DataMatrix Objects in the Bioinformatics Toolbox User's Guide.

DMobj = DataMatrix(Matrix) creates a DataMatrix object, DMobj, from Matrix, a two-dimensional numeric or logical array. Matrix can also be a DataMatrix object.

DMobj = DataMatrix(Matrix, RowNames, ColumnNames) creates a DataMatrix object, DMobj, from Matrix, a two-dimensional numeric or logical array, with row names and column names specified by RowNames and ColumnNames. RowNames and ColumnNames can be a numeric vector, character array, or cell array of strings, whose elements are equal in number to the number of rows and number of columns, respectively, in Matrix. RowNames are typically gene names or probe identifiers, while ColumnNames are typically sample identifiers.

DMobj = DataMatrix('File', FileName) creates a DataMatrix object, DMobj, from FileName, a string specifying a file name or a path and file name of a tab-delimited TXT or XLS file that contains table-oriented data and metadata.

DMobj = DataMatrix(..., 'PropertyName', PropertyValue, ...) calls DataMatrix with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Each PropertyName must be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:


DMobj = DataMatrix(..., 'RowNames', RowNamesValue, ...)
specifies row names for DMobj. RowNamesValue can be any of the following:

DMobj = DataMatrix(..., 'ColNames', ColNamesValue, ...) specifies column names for DMobj. ColNamesValue can be any of the following:

DMobj = DataMatrix(..., 'Name', NameValue, ...) specifies a name for DMobj. Default is ''.

DMobj = DataMatrix('File', FileName, ...'Delimiter', DelimiterValue, ...) specifies a delimiter symbol to use for the input file. Typical choices are:

DMobj = DataMatrix('File', FileName, ...'HLine', HLineValue, ...) specifies which row of the input file contains the column header text (column names). HLineValue is a positive integer. Default is 1. When creating the DataMatrix object DMobj, the DataMatrix function loads data from (HLineValue + 1) to the end of the file.

DMobj = DataMatrix('File', FileName, ...'Rows', RowsValue, ...) specifies a subset of row names in File for the DataMatrix function to use to create DMobj. RowsValue can be a cell array of strings, a character array, or a numeric or logical vector.

DMobj = DataMatrix('File', FileName, ...'Columns', ColumnsValue, ...) specifies a subset of column names in File for the DataMatrix function to use to create DMobj. ColumnsValue can be a cell array of strings, a character array, or a numeric or logical vector.

Examples

For examples of creating and using DataMatrix objects, see Representing Expression Data Values in DataMatrix Objects in the Bioinformatics Toolbox User's Guide.

See Also

colnames | disp | dmarrayfun | dmbsxfun | dmwrite | double | eq | ge | get | gt | horzcat | isequal | isequalwithequalnans | ldivide | le | lt | max | mean | median | min | minus | ndims | ne | numel | plot | plus | power | rdivide | rownames | set | single | sortcols | sortrows | std | sum | times | var | vertcat

How To

  


Free Computational Biology Interactive Kit

See how to analyze, visualize, and model biological data and systems using MathWorks products.

Get free kit

Trials Available

Try the latest computational biology products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS