Skip to content

Commit ea515a7

Browse files
authored
Merge pull request #2455 from opencobra/master
Update develop branch
2 parents de48877 + 02fc55c commit ea515a7

File tree

1 file changed

+14
-1
lines changed
  • src/dataIntegration/chemoInformatics/molecularWeight

1 file changed

+14
-1
lines changed

src/dataIntegration/chemoInformatics/molecularWeight/computeMW.m

+14-1
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,26 @@
6262
% molecular weight of elements in a structure
6363
elementMwStruct = struct('H', 1, 'C', 12, 'N', 14, 'O', 16, 'Na', 23, 'Mg', 24, 'P', 31, ...
6464
'S', 32, 'Cl', 35, 'K', 39, 'Ca', 40, 'Mn', 55, 'Fe', 56, 'Ni', 58, 'Co', 59, ...
65-
'Cu', 63, 'Zn', 65, 'As', 75, 'Se', 80, 'Ag', 107, 'Cd', 114, 'W', 184, 'Hg', 202);
65+
'Cu', 63, 'Zn', 65, 'As', 75, 'Se', 80, 'Ag', 107, 'Cd', 114, 'W', 184, 'Hg', 202,...
66+
'F', 19, 'I', 127, 'Ba', 137, 'Y', 89 );
6667
elementNames = fieldnames(elementMwStruct); % elements' names
6768
MW = zeros(size(metIDs));
6869

6970
for n = 1:length(metIDs)
7071
i = metIDs(n);
7172
formula = model.metFormulas(i);
73+
74+
% Skip calculations for metabolites containing 'FULLRCO'
75+
if contains(formula, 'FULLR')|| contains(formula,'R')
76+
MW(n) = NaN; % Assign NaN to indicate R-group
77+
identifire = 'R-group';
78+
continue;
79+
elseif contains(formula, 'X')
80+
MW(n) = NaN; % Assign NaN to indicate 'X'
81+
identifire = 'X';
82+
continue;
83+
end
84+
7285
[compounds, tok] = regexp(formula, '([A-Z][a-z]*)(\d*)', 'match', 'tokens');
7386
tok = tok{1, 1};
7487
for j = 1:length(tok) % go through each token.

0 commit comments

Comments
 (0)