finding same gene combination

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일

0 개 추천

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

Thanks a lot ,but a small modification in
for 'YBL095W',i need as (the value of 'YAR029W'
must not be displayed )
'YBL095W' 'd' 'd' 'd'
'YAR068W' 'du' 'uu' 'uu'
'YBL095W' 'du' 'du' 'du'
'YBL111C' 'uu' 'ud' 'du'
'YBL113C' 'uu' 'ud' 'ud'
'YBR028C' 'du' 'ud' 'ud'
for 'YBL111C' i need as (the values of ('YAR029W' 'YAR062W' must not be displayed)
'YBL111C' 'u' 'u' 'u' 'u'
'YBL095W' 'du' 'ud' 'ud' 'du'
'YBL111C' 'uu' 'uu' 'ud' 'ud'
'YBL113C' 'uu' 'uu' 'uu' 'ud'
'YBR028C' 'du' 'uu' 'uu' 'ud'
like these i need for all genes please help
per isakson
per isakson 2012년 8월 20일
I'm not sure I find the rule from your examples. I'm I right that
"for 'YBL111C' i need as (the values of ('YAR029W' 'YAR062W' must not be displayed)" because 'YAR029W' and 'YAR062W' are above 'YBL111C' in the array, final.
and
"for 'YBL095W',i need as (the value of 'YAR029W' must not be displayed )" because 'YAR029W' is above 'YBL095W' in the array, final.
per isakson
per isakson 2012년 8월 20일
I'm sure I don't understand the criteria for including rows.
At least half the problem is to specify what the algorithm should do. That is your task! Why shouldn't 'YAR062W' be included?
Pat
Pat 2012년 8월 23일
yes u r correct the above row for each gene must not be displayed ,the fist row should indicate it is 'u' or 'd' ,other rows are correct a per the code,but as specifeid by perisakson the above rows must not be displayed
please help
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

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

태그

질문:

Pat
2012년 8월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by