0001 function pathway=markPathwayWithExpression(pathway,model,experiment,experimentOrder)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if numel(experimentOrder)~=2
0016 EM='This can only be done for two cases at the moment (experimentOrder must be two elements)';
0017 dispEM(EM);
0018 end
0019
0020
0021 [present, expIds]=ismember(experimentOrder,experiment.experiments);
0022
0023 if ~all(present)
0024 EM='Not all experiments could be found in the experiment structure';
0025 dispEM(EM);
0026 end
0027
0028 experiment.data=experiment.data(:,expIds);
0029 experiment.experiments=experiment.experiments(:,expIds);
0030
0031
0032
0033 for i=1:numel(pathway.listOfSpecies)
0034 if strcmp('PROTEIN', pathway.listOfSpecies(i).type)
0035 if isfield(pathway.listOfSpecies(i),'note')
0036 if ~isempty(pathway.listOfSpecies(i).note)
0037
0038 [present, index]=ismember(pathway.listOfSpecies(i).note,model.rxns);
0039
0040
0041 if any(present)
0042 [~, genes]=find(model.rxnGeneMat(index,:));
0043
0044
0045 if any(genes)
0046 [present, experimentIndexes]=ismember(model.genes(genes),experiment.orfs);
0047
0048
0049 if any(present)
0050 pathway.listOfSpecies(i).orfs=experiment.orfs(experimentIndexes(present));
0051 pathway.listOfSpecies(i).expA=experiment.data(experimentIndexes(present),1);
0052 pathway.listOfSpecies(i).expB=experiment.data(experimentIndexes(present),2);
0053 end
0054 end
0055 end
0056 end
0057 end
0058 end
0059 end
0060 end