/
defaultLookMap.m
207 lines (191 loc) · 9.59 KB
/
defaultLookMap.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
function [newmap] = defaultLookMap(map)
% Give default look to structures on map in terms of color, size and areaWidth.
%
% USAGE:
%
% [newmap] = defaultLookMap(map)
%
% INPUT:
% map: Map from CellDesigner parsed to matlab format
%
% OUTPUT:
% newmap: MATLAB structure of new map with default look
%
% NOTE:
% Note that this is specific to MitoMap and Recon3Map, as it uses Recon3
% and PDmap nomenclature for metabolites
%
% .. Authors:
% - A.Danielsdottir 01/08/2017 LCSB. Belval. Luxembourg
% - N.Sompairac - Institut Curie, Paris, 01/08/2017.
newmap = map;
colors = createColorsMap();
% Set all rxn lines to black and normal areaWidth
color = 'BLACK';
areaWidth = 1.0;
for j = 1:length(newmap.rxnName)
newmap.rxnColor{j} = colors(color);
newmap.rxnWidth{j} = areaWidth;
end
% Use the existence of reactant lines to check if the map has the
% complete structure, and if so change also secondary lines.
if any(strcmp('rxnReactantLineColor', fieldnames(map))) == 1
for j = 1:length(newmap.rxnName)
if ~isempty(newmap.rxnReactantLineColor{j})
for k = 1:length(map.rxnReactantLineColor{j})
newmap.rxnReactantLineColor{j, 1}{k, 1} = colors(color);
newmap.rxnReactantLineWidth{j, 1}{k, 1} = areaWidth;
end
end
if ~isempty(newmap.rxnProductLineColor{j})
for m = 1:1:length(newmap.rxnProductLineColor{j})
newmap.rxnProductLineColor{j, 1}{m, 1} = colors(color);
newmap.rxnProductLineWidth{j, 1}{m, 1} = areaWidth;
end
end
end
end
% Start with giving all simple molecules the CellDesigner default color and size
smID = newmap.specID(ismember(newmap.specType, 'SIMPLE_MOLECULE'));
smAlias = find(ismember(newmap.molID, smID));
for i = smAlias'
newmap.molColor{i} = 'ffccff66';
newmap.molWidth{i} = '70';
newmap.molHeight{i} = '25';
end
% Use the existence of reactant lines to check if the map has the
% complete structure, and if so change also included species.
if any(strcmp('rxnReactantLineColor', fieldnames(map))) == 1
smIncID = newmap.specIncID(ismember(newmap.specIncType, 'SIMPLE_MOLECULE'));
smIncAlias = find(ismember(newmap.molID, smIncID));
for i = smIncAlias'
newmap.molColor{i} = 'ffccff66';
newmap.molWidth{i} = '70';
newmap.molHeight{i} = '25';
end
end
% Identify the metabolites that should be considered "secondary
% metabolites"
% Groups of metabolites as chosen during drawing of Recon3map
mets{1} = {'^atp\[\w\]'; '^adp\[\w\]'; '^amp\[\w\]'; '^utp\[\w\]'; '^udp\[\w\]'; '^ump\[\w\]'; '^ctp\[\w\]'; '^cdp\[\w\]'; '^cmp\[\w\]'; '^gtp\[\w\]'; '^gdp\[\w\]'; '^gmp\[\w\]'; '^imp\[\w\]'; '^idp\[\w\]'; '^itp\[\w\]'; '^dgtp\[\w\]'; '^dgdp\[\w\]'; '^dgmp\[\w\]'; '^datp\[\w\]'; '^dadp\[\w\]'; '^damp\[\w\]'; '^dctp\[\w\]'; '^dcdp\[\w\]'; '^dcmp\[\w\]'; '^dutp\[\w\]'; '^dudp\[\w\]'; '^dump\[\w\]'; '^dttp\[\w\]'; '^dtdp\[\w\]'; '^dtmp\[\w\]'; '^pppi\[\w\]'; '^ppi\[\w\]'; '^pi\[\w\]'};
mets{2} = {'^h2o\[\w\]'};
mets{3} = {'^h\[\w\]'};
mets{4} = {'^nadp\[\w\]'; '^nadph\[\w\]'; '^nad\[\w\]'; '^nadh\[\w\]'; '^fad\[\w\]'; '^fadh2\[\w\]'; '^fmn\[\w\]'; '^fmnh2\[\w\]'; 'FAD'; 'FADH2'; 'NAD(_plus_)'; 'NADH'};
% Also with PDmap nomenclature, for full version of MitoMap, as these
% are sometimes included in complexes.
mets{5} = {'^coa\[\w\]'};
mets{6} = {'^h2o2\[\w\]'; '^o2\[\w\]'; '^co2\[\w\]'; '^co\[\w\]'; '^no\[\w\]'; '^no2\[\w\]'; '^o2s\[\w\]'; '^oh1\[\w\]'};
mets{7} = {'^na1\[\w\]'; '^nh4\[\w\]'; '^hco3\[\w\]'; '^h2co3\[\w\]'; '^so4\[\w\]'; '^so3\[\w\]'; '^cl\[\w\]'; '^k\[\w\]'; '^ca2\[\w\]'; '^fe2\[\w\]'; '^fe3\[\w\]'; '^i\[\w\]'; '^zn2\[\w\]'; 'Ca2_plus_'; 'Cl_minus_'; 'Co2_plus_'; 'Fe2_plus_'; 'Fe3_plus_'; 'H_plus_'; 'K_plus_'; 'Mg2_plus_'; 'Mn2_plus_'; 'Na_plus_'; 'Ni2_plus_'; 'Zn2_plus_'};
% Also added are names of ions in PD map, for full version of MitoMap,
% as ions are sometimes included in complexes
% Carnitine to be reviewed later, if it should be visualized differently
% from "general" metabolites or not (01082017)
mets{8} = {'^crn\[\w\]'};
% Choose seperate color for each metabolite group. Avoid using bright red,
% as that is default color for highlighting fluxes and moieties.
clr{1} = 'fff0adbb'; % faded red/pink ;
clr{2} = 'ff79adf5'; % blue
clr{3} = 'ffb993ec'; % purple
clr{4} = 'ff06f7e1'; % light blue
clr{5} = 'fff0a10e'; % orange
clr{6} = 'ff61f81b'; % green
clr{7} = 'fff5f81b'; % yellow
clr{8} = 'ff99edc5'; % sea green
for i = 1:8
list = mets{i};
% find species ID for each metabolite in a group
index = [];
for h = list'
j = find(~cellfun(@isempty, regexp(newmap.specName, h)));
index = [index; j];
end
specID = newmap.specID(index);
% Find index of all aliases of each species
index2 = find(ismember(newmap.molID, specID));
% Change clr and size (same size for all metabolite groups, smaller than "main metabolites")
for k = index2'
newmap.molColor{k} = clr{i};
newmap.molWidth{k} = '50.0';
newmap.molHeight{k} = '20.0';
end
% If complete structure is used, also change for included species
if any(strcmp('rxnReactantLineColor', fieldnames(map))) == 1
index3 = [];
for h = list'
j = find(~cellfun(@isempty, regexp(newmap.specIncName, h)));
index3 = [index3; j];
end
specIncID = newmap.specIncID(index3);
index4 = find(ismember(newmap.molID, specIncID));
for k = index4'
newmap.molColor{k} = clr{i};
newmap.molWidth{k} = '50.0';
newmap.molHeight{k} = '20.0';
end
end
end
% Define and change species type for known "secondary" metabolites from model
% (all ions will acquire round shape instead of oval, no matter how areaWidth and height is defined)
ions = {'^h\[\w\]'; '^na1\[\w\]'; '^cl\[\w\]'; '^k\[\w\]'; '^ca2\[\w\]'; '^fe2\[\w\]'; '^fe3\[\w\]'; '^i\[\w\]'; '^zn2\[\w\]'; 'Ca2_plus_'; 'Cl_minus_'; 'Co2_plus_'; 'Fe2_plus_'; 'Fe3_plus_'; 'H_plus_'; 'K_plus_'; 'Mg2_plus_'; 'Mn2_plus_'; 'Na_plus_'; 'Ni2_plus_'; 'Zn2_plus_'};
nonIons = {'^atp\[\w\]'; '^adp\[\w\]'; '^amp\[\w\]'; '^utp\[\w\]'; '^udp\[\w\]'; '^ump\[\w\]'; '^ctp\[\w\]'; '^cdp\[\w\]'; '^cmp\[\w\]'; '^gtp\[\w\]'; '^gdp\[\w\]'; '^gmp\[\w\]'; '^imp\[\w\]'; '^idp\[\w\]'; '^itp\[\w\]'; '^dgtp\[\w\]'; '^dgdp\[\w\]'; '^dgmp\[\w\]'; '^datp\[\w\]'; '^dadp\[\w\]'; '^damp\[\w\]'; '^dctp\[\w\]'; '^dcdp\[\w\]'; '^dcmp\[\w\]'; '^dutp\[\w\]'; '^dudp\[\w\]'; '^dump\[\w\]'; '^dttp\[\w\]'; '^dtdp\[\w\]'; '^dtmp\[\w\]'; '^pppi\[\w\]'; '^ppi\[\w\]'; '^pi\[\w\]'; '^h2o\[\w\]'; '^nadp\[\w\]'; '^nadph\[\w\]'; '^nad\[\w\]'; '^nadh\[\w\]'; '^fad\[\w\]'; '^fadh2\[\w\]'; '^fmn\[\w\]'; '^fmnh2\[\w\]'; '^coa\[\w\]'; '^h2o2\[\w\]'; '^o2\[\w\]'; '^co2\[\w\]'; '^co\[\w\]'; '^no\[\w\]'; '^no2\[\w\]'; '^o2s\[\w\]'; '^oh1\[\w\]'; '^nh4\[\w\]'; '^hco3\[\w\]'; '^h2co3\[\w\]'; '^so4\[\w\]'; '^so3\[\w\]'; '^crn\[\w\]'; 'FAD'; 'FADH2'; 'NAD(_plus_)'; 'NADH'};
ionindex = [];
for i = ions'
% Find species index for ions
j = find(~cellfun(@isempty, regexp(newmap.specName, i)));
ionindex = [ionindex; j];
end
for j = ionindex'
newmap.specType{j} = 'ION';
end
% If complete structure is used, also change for included species
if any(strcmp('rxnReactantLineColor', fieldnames(map))) == 1
ionIncindex = [];
for i = ions'
% Find species index for ions
m = find(~cellfun(@isempty, regexp(newmap.specIncName, i)));
ionIncindex = [ionIncindex; m];
end
for m = ionIncindex'
newmap.specType{m} = 'ION';
end
end
% Give the type simple molecule, in case they were manually drawn with wrong
% species type (this is not done for the whole species list, in case there are proteins, receptors, etc. present on map)
notIonIndex = [];
for i = nonIons'
j = find(~cellfun(@isempty, regexp(newmap.specName, i)));
notIonIndex = [notIonIndex; j];
end
for j = notIonIndex'
newmap.specType{j} = 'SIMPLE_MOLECULE';
end
% If complete structure is used, also change for included species
if any(strcmp('rxnReactantLineColor', fieldnames(map))) == 1
notIonIncIndex = [];
for i = nonIons'
m = find(~cellfun(@isempty, regexp(newmap.specIncName, i)));
notIonIncIndex = [notIonIncIndex; m];
end
for m = notIonIncIndex'
newmap.specIncType{m} = 'SIMPLE_MOLECULE';
end
end
% Give unified look to all proteins
protID = newmap.specID(ismember(newmap.specType, 'PROTEIN'));
protAlias = find(ismember(newmap.molID, protID));
for i = protAlias'
newmap.molColor{i} = 'ffccffcc';
newmap.molWidth{i} = '55';
newmap.molHeight{i} = '30';
end
% If complete structure is used, also change for included species
if any(strcmp('rxnReactantLineColor', fieldnames(map))) == 1
protIncID = newmap.specIncID(ismember(newmap.specIncType, 'PROTEIN'));
protIncAlias = find(ismember(newmap.molID, protIncID));
for i = protIncAlias'
newmap.molColor{i} = 'ffccffcc';
newmap.molWidth{i} = '55';
newmap.molHeight{i} = '30';
end
end
end