exportModel Sort reactions, metabolites, genes and compartments alphabetically by their identifier. Input: model a model structure Output: newModel an updated model structure with alphabetically sorted identifiers Usage: newModel=sortIdentifiers(model)
0001 function newModel = sortIdentifiers(model) 0002 % exportModel 0003 % Sort reactions, metabolites, genes and compartments alphabetically by 0004 % their identifier. 0005 % 0006 % Input: 0007 % model a model structure 0008 % 0009 % Output: 0010 % newModel an updated model structure with alphabetically sorted 0011 % identifiers 0012 % 0013 % Usage: newModel=sortIdentifiers(model) 0014 0015 [~,I]=sort(model.rxns); 0016 newModel=permuteModel(model,I,'rxns'); 0017 [~,I]=sort(newModel.mets); 0018 newModel=permuteModel(newModel,I,'mets'); 0019 if isfield(newModel,'genes') 0020 [~,I]=sort(newModel.genes); 0021 newModel=permuteModel(newModel,I,'genes'); 0022 end 0023 [~,I]=sort(newModel.comps); 0024 newModel=permuteModel(newModel,I,'comps'); 0025 end