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,
string vector, or cell array of character vectors,
whose elements are equal in number to the number
of rows in Note The row names do not need to be unique. |
ColumnNames
| Column names for the DataMatrix object, specified by a numeric vector, character array,
string vector, or cell array of character vectors,
whose elements are equal in number to the number
of columns in Note The column names do not need to be unique. |
FileName | Character vector or 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
|
RowNamesValue , ColNamesValue | Row names or column names for the DataMatrix object. Choices are:
Note The row or column names do not need to be unique. |
NameValue | Character vector or string specifying a name for the DataMatrix object. Default is
|
DelimiterValue | Character vector or string specifying a delimiter symbol to use for the input file. Typical choices are:
|
HLineValue | Positive integer that specifies which row of the input
file contains the column header text (column names). Default is When
creating the DataMatrix object Tip If the input file does not contain column header text (column
names), set |
RowsValue , ColumnsValue | A subset of rows or columns in
|
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.
Note
The DataMatrix constructor function is part of the microarray object package. To make it available, type the following in the MATLAB® command line:
import bioma.data.*
Otherwise, use bioma.data.DataMatrix
instead
of DataMatrix
, in the following syntaxes.
creates a
DataMatrix object, DMobj
=
DataMatrix(Matrix
)DMobj
, from Matrix
,
a two-dimensional numeric or logical array. Matrix
can
also be a DataMatrix object.
creates a DataMatrix object, DMobj
=
DataMatrix(Matrix
, RowNames
, ColumnNames
)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, string vector, or cell array of character vectors, 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.
Note
The row or column names do not need to be unique.
creates a DataMatrix object, DMobj
=
DataMatrix('File', FileName
)DMobj
, from
FileName
, a character vector or 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
.
calls DMobj
= DataMatrix(...,
'PropertyName
', PropertyValue
,
...)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:
specifies row names for DMobj
=
DataMatrix(..., 'RowNames', RowNamesValue
,
...)DMobj
. RowNamesValue
can
be any of the following:
Numeric vector, character array, string vector, or a cell array of character vectors, whose elements are equal in number to the number of rows of numeric data in the input matrix.
A character vector or string, which is used as a prefix for row names. Row numbers will be appended to the prefix.
true
— Unique row names will be assigned using the formatrow1
,row2
,row3
, etc.false
— Default. No row names are assigned.
Note
The row names do not need to be unique.
specifies
column names for DMobj
= DataMatrix(...,
'ColNames', ColNamesValue
, ...)DMobj
. ColNamesValue
can
be any of the following:
Numeric vector, character array, string vector, or a cell array of character vectors, whose elements are equal in number to the number of columns of numeric data in the input matrix.
A character vector or string, which is used as a prefix for column names. Column numbers will be appended to the prefix.
true
— Unique column names will be assigned using the formatcol1
,col2
,col3
, etc.false
— Default. No column names are assigned.
Note
The column names do not need to be unique.
specifies
a name for DMobj
= DataMatrix(...,
'Name', NameValue
, ...)DMobj
. Default is ''
.
specifies a delimiter symbol to use for the input
file. Typical choices are:DMobj
=
DataMatrix('File', FileName
, ...'Delimiter', DelimiterValue
,
...)
' '
'\t'
(default)','
';'
'|'
specifies which row of the input file contains the
column header text (column names). DMobj
=
DataMatrix('File', FileName
, ...'HLine', HLineValue
,
...)HLineValue
is
a positive integer. Default is 1
. When creating
the DataMatrix object DMobj
, the DataMatrix
function
loads data from (
) to the end of the file.HLineValue
+
1
Tip
If the input file does not contain column header text (column
names), set HLineValue
to 0
.
specifies a subset of row names in DMobj
=
DataMatrix('File', FileName
, ...'Rows', RowsValue
,
...)File
for the
DataMatrix
function to use to create DMobj
.
RowsValue
can be a cell array of character vectors, a character
array, string vector, or a numeric or logical vector.
specifies a subset of column names in DMobj
=
DataMatrix('File', FileName
, ...'Columns', ColumnsValue
,
...)File
for the
DataMatrix
function to use to create DMobj
.
ColumnsValue
can be a cell array of character vectors, string vector,
character array, or numeric or logical vector.
Examples
For examples of creating and using DataMatrix objects, see Representing Expression Data Values in DataMatrix Objects.
Version History
Introduced in R2008b
See Also
colnames
| disp
| dmarrayfun
| dmbsxfun
| dmwrite
| double
| eq
| ge
| get
| gt
| horzcat
| isequal
| isequaln
| 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