Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore conflicting grRules and display additional warning #92

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
24 changes: 14 additions & 10 deletions ecHumanGEM/scripts/preprocessModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,21 @@
name = [];
end
end
model = removeFields(model);
[grRules, rxnGeneMat] = standardizeGrRules(model);
model.grRules = grRules;
model.rxnGeneMat = rxnGeneMat;
model = removeFields(model);
%find conflicting grRules in model
[~,~,conflicts] = standardizeGrRules(model);
if ~isempty(conflicts)
warning(sprintf('\nConflicting grRules where found for several reactions (check the above lines). GECKO will ignore these grRules to avoid introduction of potentially wrong enzyme constrains for such cases. It is recommended to check your original GEM and fix these grRules manually with the guidance provided by the function "standardizeGrRules.m" in the RAVEN toolbox.\n'))
end
%delete conflicting grRules to avoid weird enzyme constraints
model.grRules(conflicts) = {''};
%Remove gene rules from pseudoreactions (if any):
for i = 1:length(model.rxns)
if endsWith(model.rxnNames{i},' pseudoreaction')
model.grRules{i} = '';
model.rxnGeneMat(i,:) = zeros(1,length(model.genes));
end
end
pseudoRxns = endsWith(model.rxnNames,' pseudoreaction');
model.grRules(pseudoRxns) = {''};
%standardize grRules
[grRules,rxnGeneMat] = standardizeGrRules(model);
model.grRules = grRules;
model.rxnGeneMat = rxnGeneMat;
% Standardizes the metabolites names
model = modifyMetNames(model);

Expand Down