markPathwayWithFluxes Marks each enzyme in a pathway structure with the corresponding fluxes from two simulation results. This is done for enzymes that has the name of a reaction in the note field. The reaction has to be present in reactionIDs. pathway pathway structure of the metabolic network reactionsIDs cell array with the names of the reactions in the model fluxes vector with flux values referenceFluxes vector with fluxes to compare to returnPathway updates the original pathway structure by adding the fields flux and referenceFlux for each marked reaction errorFlag true if there has been an error Usage: [returnPathway errorFlag] = markPathwayWithFluxes(pathway, reactionIDs, fluxes, referenceFluxes) Rasmus Agren, 2010-12-16
0001 function [returnPathway errorFlag]= markPathwayWithFluxes(pathway, reactionIDs, fluxes, referenceFluxes) 0002 % markPathwayWithFluxes 0003 % Marks each enzyme in a pathway structure with the corresponding fluxes 0004 % from two simulation results. This is done for enzymes that has the name 0005 % of a reaction in the note field. The reaction has to be present in 0006 % reactionIDs. 0007 % 0008 % pathway pathway structure of the metabolic network 0009 % reactionsIDs cell array with the names of the reactions in the model 0010 % fluxes vector with flux values 0011 % referenceFluxes vector with fluxes to compare to 0012 % 0013 % returnPathway updates the original pathway structure by adding the 0014 % fields flux and referenceFlux for each marked reaction 0015 % errorFlag true if there has been an error 0016 % 0017 % Usage: [returnPathway errorFlag] = markPathwayWithFluxes(pathway, reactionIDs, 0018 % fluxes, referenceFluxes) 0019 % 0020 % Rasmus Agren, 2010-12-16 0021 % 0022 0023 %Check if all variables are of the correct dimension 0024 if length(reactionIDs)~=length(fluxes) || length(reactionIDs)~=length(referenceFluxes) 0025 returnPathway=pathway; 0026 errorFlag=1; 0027 fprintf('reactionIDs, fluxes, and referenceFluxes do not have the same number of elements.'); 0028 return; 0029 end 0030 0031 %Loop through the components in the pathway. Check if any component has a 0032 %note and then check for the corresponding reaction id 0033 returnPathway=pathway; 0034 0035 for i=1:length(pathway.listOfSpecies) 0036 if strcmpi(pathway.listOfSpecies(i).type,'PROTEIN') 0037 if isfield(pathway.listOfSpecies(i),'note') 0038 if ~isempty(pathway.listOfSpecies(i).note) 0039 %If there is a note check if there is a corresponding reaction id 0040 index=find(strcmpi(reactionIDs,pathway.listOfSpecies(i).note)); 0041 %If there is a match 0042 if any(index) 0043 returnPathway.listOfSpecies(i).flux=fluxes(index); 0044 returnPathway.listOfSpecies(i).referenceFlux=referenceFluxes(index); 0045 end 0046 end 0047 end 0048 end 0049 end