-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
function [justConsumedMets, justProducedMets]=findRootDeadEndMets(model) | ||
% This script will find metabolites which are just produced or just | ||
% consumed in the reactions. These metabolites cause | ||
% deadEnd reactions. | ||
% | ||
% model a model structure | ||
% justConsumedMets list of metabolites which are just consumed by | ||
% the model | ||
% justProducedMets list of metabolites which are just produced by | ||
% the model | ||
% | ||
% Rasool Saghaleyni, 2020-03-07 | ||
|
||
% Adding all boundry metabolites to the model | ||
model = addBoundaryMets(model); | ||
% remove all both directional reactions from model | ||
uniModel=removeReactions(model,model.rxns(model.rev==1)); | ||
% generate a model just containing both directional reactions | ||
forwModel=removeReactions(model,model.rxns(model.rev==0)); | ||
% fixing directionality of direction | ||
forwModel.rev(:,1) = 0; | ||
% generate a model just containing both directional reactions | ||
revModel=removeReactions(model,model.rxns(model.rev==0)); | ||
% change directionality of reaction to reverse | ||
revModel.S=-revModel.S; | ||
% fixing directionality of direction | ||
revModel.rev(:,1) = 0; | ||
% adding removed reactions to main model | ||
newModel=mergeModels({uniModel,forwModel,revModel}); | ||
% finding metabolites which are just produced or consumed in all | ||
% reactions | ||
for i=1:size(newModel.mets) | ||
if size(find(newModel.S(i,:)<0),2)==0 | ||
all_mets(i,1)={'prod'}; | ||
elseif size(find(newModel.S(i,:)>0),2)==0 | ||
all_mets(i,1)={'cons'}; | ||
end | ||
end | ||
% if you add this metabolites to the model using addExchangeRxns function, there will | ||
% not be any deadEnd reaction in the model. | ||
justConsumedMets=newModel.mets(strcmp(all_mets,'cons')); | ||
justProducedMets=newModel.mets(strcmp(all_mets,'prod')); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.