0001 function notMapped=drawMap(title,pathway,modelA,conditionA,conditionB,modelB,filename,cutOff,supressOpen)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 if nargin<4
0031 conditionB=conditionA;
0032 end
0033
0034 if nargin<5
0035 modelB=modelA;
0036 end
0037
0038 if nargin<8
0039 cutOff=10^-7;
0040 end
0041
0042 if nargin<9
0043 supressOpen=false;
0044 end
0045
0046 if isempty(conditionB)
0047 conditionB=conditionA;
0048 end
0049
0050 if isempty(modelB)
0051 modelB=modelA;
0052 end
0053
0054 objectiveNames=modelA.rxns(modelA.c~=0);
0055 objectiveValues=modelA.c(modelA.c~=0);
0056
0057
0058 conditionA(abs(conditionA)<cutOff)=0;
0059 conditionB(abs(conditionB)<cutOff)=0;
0060
0061
0062 carriesFlux=union(modelA.rxns,modelB.rxns);
0063
0064 rxnsInModel={};
0065
0066 for i=1:numel(pathway.listOfSpecies)
0067 if strcmp(pathway.listOfSpecies(i).type,'PROTEIN')
0068 if ~isempty(pathway.listOfSpecies(i).note)
0069 rxnsInModel=[rxnsInModel;pathway.listOfSpecies(i).note(1)];
0070 end
0071 end
0072 end
0073
0074
0075
0076
0077 rxnBoundsA=find(modelA.ub~=max(modelA.ub) | (modelA.lb~=-max(modelA.ub) & modelA.rev==1) | (modelA.lb~=0 & modelA.rev==0));
0078 rxnBoundsB=find(modelB.ub~=max(modelB.ub) | (modelB.lb~=-max(modelB.ub) & modelB.rev==1) | (modelB.lb~=0 & modelB.rev==0));
0079
0080 notMapped=setdiff(carriesFlux,rxnsInModel);
0081
0082 pathway=colorPathway(pathway,modelA.rxns,conditionA,conditionB,cutOff);
0083 pathway=markPathwayWithFluxes(pathway,modelA.rxns,conditionA,conditionB);
0084
0085 h=figure('Visible','Off');
0086 drawPathway(pathway,h,cutOff);
0087
0088
0089 plotLabels(h,pathway);
0090 setTitle(h,pathway,title);
0091
0092
0093 exampleBoxText(1)={'Reaction ID'};
0094 exampleBoxText(2)={'Condition A'};
0095 exampleBoxText(3)={'Condition B'};
0096 if nargin>7
0097 exampleBoxText(4)={'Other data'};
0098 end
0099
0100 additionalText={};
0101 additionalText=[additionalText;{'Objective function'}];
0102
0103 additionalText=[additionalText;{getObjectiveString(true, objectiveNames, objectiveValues)}];
0104 additionalText=[additionalText;{''}];
0105 additionalText=[additionalText;{'Constraints (condition A)'}];
0106
0107 counter=numel(additionalText)+1;
0108 for i=1:length(rxnBoundsA)
0109 additionalText{counter}=[modelA.rxns{rxnBoundsA(i)} ' [' ...
0110 num2str([modelA.lb(rxnBoundsA(i)) modelA.ub(rxnBoundsA(i))]) ']'];
0111 counter=counter+1;
0112 end
0113
0114 additionalText=[additionalText;{''}];
0115 additionalText=[additionalText;{'Constraints (condition B)'}];
0116
0117 counter=numel(additionalText)+1;
0118 for i=1:length(rxnBoundsB)
0119 additionalText{counter}=[modelB.rxns{rxnBoundsB(i)} ' [' ...
0120 num2str([modelB.lb(rxnBoundsB(i)) modelB.ub(rxnBoundsB(i))]) ']'];
0121 counter=counter+1;
0122 end
0123
0124 plotAdditionalInfo(h, pathway, additionalText, exampleBoxText, 1);
0125
0126 if nargin>5
0127 if any(filename)
0128 set(gcf, 'PaperType', 'A4');
0129 orient landscape;
0130 print('-dpdf', '-r600', filename);
0131 fprintf('File saved as %s\n',filename);
0132 end
0133 end
0134
0135 if supressOpen==false
0136 open(filename);
0137 end
0138 end