Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
help with DataMatrix objects

Subject: help with DataMatrix objects

From: Ugo

Date: 20 Feb, 2009 12:14:01

Message: 1 of 4

Dear all,
I created a DataMatrix Object with my microarray data. I am trying to find a subset (~2000) of all the probesetIDs on the DataMatrix Object. I have the probesetIDs I am interested in a cell variable. It is easy for me (consider I am a biologist!) to work with 2 cells but how can I extract specific probsetIDs, and their values, from a DataMatrix Object?
Thank you for your help

Ugo

Subject: help with DataMatrix objects

From: Lucio Andrade-Cetto

Date: 20 Feb, 2009 14:11:03

Message: 2 of 4

Ugo:
Here is an example on how to extract specific probsetIDs:

Variable d is a DataMatrix
>> d =

                Sample1 Sample2 Sample3 Sample4
    Feature1 71 72 73 74
    Feature2 81 82 83 84
    Feature3 91 92 93 94
    Feature4 101 142 143 144
Feature5 151 152 153 154

To subset with row names and column names:
>> d({'Feature1', 'Feature4'},{'Sample1', 'Sample3'})

ans =

                Sample1 Sample3
    Feature1 71 73
    Feature4 101 143


To extract only the values of a subset with row names and column names:
>> d.({'Feature1', 'Feature4'})({'Sample1', 'Sample3'})

ans =

    71 73
   101 143

Or
>>rowIdx ={'Feature1', 'Feature4'};
>> colIdx ={'Sample2', 'Sample4'};

>> d(rowIdx,colIdx)

ans =

                Sample2 Sample4
    Feature1 72 74
    Feature4 142 144

>> d.(rowIdx)(colIdx)

ans =

    72 74
   142 144

The indexing can be a numeric or logical vector like other MATLAB arrays, or cell arrays of strings for indexing.

One more thing, the colon operator should work also:

>> d(rowIdx, :)

ans =

                Sample1 Sample2 Sample3 Sample4
    Feature1 71 72 73 74
    Feature4 101 142 143 144

>> d.(rowIdx)(':') %Colon is in single quote – ‘:’

ans =

    71 72 73 74
   101 142 143 144

Let me know if this solves your question.
Lucio

"Ugo " <borello.ugo@ijm.jussieu.fr> wrote in message <gnm6q9$s6v$1@fred.mathworks.com>...
> Dear all,
> I created a DataMatrix Object with my microarray data. I am trying to find a subset (~2000) of all the probesetIDs on the DataMatrix Object. I have the probesetIDs I am interested in a cell variable. It is easy for me (consider I am a biologist!) to work with 2 cells but how can I extract specific probsetIDs, and their values, from a DataMatrix Object?
> Thank you for your help
>
> Ugo

Subject: help with DataMatrix objects

From: Lucio Andrade-Cetto

Date: 20 Feb, 2009 14:16:03

Message: 3 of 4

You can also find more information here on how to use the DataMatrix object here:
http://www.mathworks.com/access/helpdesk/help/toolbox/bioinfo/ug/brsyo6j.html
Lucio


"Ugo " <borello.ugo@ijm.jussieu.fr> wrote in message <gnm6q9$s6v$1@fred.mathworks.com>...
> Dear all,
> I created a DataMatrix Object with my microarray data. I am trying to find a subset (~2000) of all the probesetIDs on the DataMatrix Object. I have the probesetIDs I am interested in a cell variable. It is easy for me (consider I am a biologist!) to work with 2 cells but how can I extract specific probsetIDs, and their values, from a DataMatrix Object?
> Thank you for your help
>
> Ugo

Subject: help with DataMatrix objects

From: Ugo

Date: 20 Feb, 2009 14:45:04

Message: 4 of 4

Thank you Lucio.
So if:
a=cell variable containing my probesetIDs list
d=your datamatrix object variable
What will be a simple 'for' loop to find the indices in d of the corresponding probesetIDs of A?
Thank you for your help.

Ugo

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us