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 CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by