finding same gene combination

3 ビュー (過去 30 日間)
Pat
Pat 2012 年 8 月 17 日
I have two datasets in
final =
'Genes' 'T0&T2' 'T1&T3' 'T2&T4' 'T3&T5' 'T4&t6'
'YAR029W' 'd' [] 'd' [] 'd'
'YBL095W' 'd' [] [] 'd' 'd'
'YBL111C' 'u' 'u' 'u' 'u' []
'YBL113C' 'u' 'u' 'u' 'u' 'u'
'YBR096W' 'u' 'u' 'u' 'u' []
'YBR138C' 'd' [] [] 'd' 'd'
Dataset1 =
'Genes' 'T0&T2' 'T1&T3' 'T2&T4' 'T3&T5' 'T4&T6'
'YAR029W' 'dd' 'uu' 'dd' 'uu' 'du'
'YAR062W' 'du' 'uu' 'ud' 'uu' 'du'
'YAR068W' 'du' 'uu' 'uu' 'uu' 'uu'
'YBL095W' 'du' 'ud' 'ud' 'du' 'du'
'YBL111C' 'uu' 'uu' 'ud' 'ud' 'du'
'YBL113C' 'uu' 'uu' 'uu' 'ud' 'ud'
'YBR028C' 'du' 'uu' 'uu' 'ud' 'ud'
I want to compare two datasets and display the result corresponding to dataset1,for example
In variable final 'YAR029W' has values in intervals 'T0&T2','T2&T4','T4&t6',so i want to display as
'Genes' 'T0&T2' 'T2&T4' 'T4&t6'
'YAR029W' 'd' 'd' 'd'
'YAR062W' 'du' 'ud' 'du'
'YAR068W' 'du' 'uu' 'uu'
'YBL095W' 'du' 'ud' 'du'
'YBL111C' 'uu' 'ud' 'du'
'YBL113C' 'uu' 'uu' 'ud'
'YBR028C' 'du' 'uu' 'ud'
for next gene
'Genes' 'T0&T2' 'T3&T5' 'T4&t6'
'YBL095W' 'd' 'd' 'd'
'YBL111C' 'uu' 'ud' 'du'
'YBL113C' 'uu' 'ud' 'ud'
'YBR028C' 'du' 'ud' 'ud'
i want to display for all genes in 'final' please help

回答 (1 件)

per isakson
per isakson 2012 年 8 月 18 日
編集済み: per isakson 2012 年 8 月 20 日
I failed to come up with an algorithm based on dataset objects. I find the documentation hard to interpret. Here is an algorithm based on cell arrays. The result is in a structure, S, with one gene per field. I guess this dataset is not optimal for this problem.
function S = cssm()
% I have two datasets in
final = {
'Genes' 'T0&T2' 'T1&T3' 'T2&T4' 'T3&T5' 'T4&t6'
'YAR029W' 'd' [] 'd' [] 'd'
'YBL095W' 'd' [] [] 'd' 'd'
'YBL111C' 'u' 'u' 'u' 'u' []
'YBL113C' 'u' 'u' 'u' 'u' 'u'
'YBR096W' 'u' 'u' 'u' 'u' []
'YBR138C' 'd' [] [] 'd' 'd'};
Dataset1 = {
'Genes' 'T0&T2' 'T1&T3' 'T2&T4' 'T3&T5' 'T4&T6'
'YAR029W' 'dd' 'uu' 'dd' 'uu' 'du'
'YAR062W' 'du' 'uu' 'ud' 'uu' 'du'
'YAR068W' 'du' 'uu' 'uu' 'uu' 'uu'
'YBL095W' 'du' 'ud' 'ud' 'du' 'du'
'YBL111C' 'uu' 'uu' 'ud' 'ud' 'du'
'YBL113C' 'uu' 'uu' 'uu' 'ud' 'ud'
'YBR028C' 'du' 'uu' 'uu' 'ud' 'ud' };
for ff = 2 : size( final, 1 )
is_data = not( cellfun( @isempty, final( ff, 1:end ) ) );
S.( final{ff,1} ) = Dataset1( :, is_data );
S.( final{ff,1} )(ff,:) = final( ff, is_data );
end
end
==============
S = cssm()
S =
YAR029W: {8x4 cell}
YBL095W: {8x4 cell}
YBL111C: {8x5 cell}
YBL113C: {8x6 cell}
YBR096W: {8x5 cell}
YBR138C: {8x4 cell}
>> S.YAR029W
ans =
'Genes' 'T0&T2' 'T2&T4' 'T4&T6'
'YAR029W' 'd' 'd' 'd'
'YAR062W' 'du' 'ud' 'du'
'YAR068W' 'du' 'uu' 'uu'
'YBL095W' 'du' 'ud' 'du'
'YBL111C' 'uu' 'ud' 'du'
'YBL113C' 'uu' 'uu' 'ud'
'YBR028C' 'du' 'uu' 'ud'
  6 件のコメント
per isakson
per isakson 2012 年 8 月 23 日
編集済み: per isakson 2012 年 8 月 23 日
You did not answer this one:
Why shouldn't 'YAR062W' be included?
I insist, you should try harder on the requirement specification. It's your problem not mine.
Pat
Pat 2012 年 8 月 27 日
I could not understand ur comments ,where it should be included

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by