Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions io/readYAMLmodel.m
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@
[~, model.metComps] = ismember(model.metComps, model.comps);
[~, model.geneComps] = ismember(model.geneComps, model.comps);
[~, model.rxnComps] = ismember(model.rxnComps, model.comps);
% A metabolite with no explicit compartment is still ismember'd above (it
% parses as ''), so it resolves to 0 -- not the "assume first compartment"
% default the emptyOrFill call further down intends -- unless it happens
% to be the trailing metabolite in the file, the only case emptyOrFill
% actually reaches (it only extends a too-short array, and ismember has
% already made this one full-length). Catch every 0 here so the default
% applies regardless of position, not just at the end of the list.
model.metComps(model.metComps==0) = 1;

% Fill S-matrix
rxnIdx = cellfun('isempty', equations(:,1));
Expand Down Expand Up @@ -725,10 +733,10 @@
for i={'metNames','inchis','metFormulas','metMiriams','metFrom','metSmiles','metNotes'} % Empty strings
model = emptyOrFill(model,i{1},{''},'mets');
end
for i={'metCharges','unconstrained'} % Zeros
for i={'unconstrained'} % Zeros
model = emptyOrFill(model,i{1},0,'mets');
end
for i={'metDeltaG'} % % NaNs
for i={'metCharges','metDeltaG'} % NaNs
model = emptyOrFill(model,i{1},NaN,'mets');
end
for i={'metComps'} % Ones, assume first compartment
Expand Down