Home > pathway > markPathwayWithFluxes.m

markPathwayWithFluxes

PURPOSE ^

markPathwayWithFluxes

SYNOPSIS ^

function [returnPathway, errorFlag]= markPathwayWithFluxes(pathway, reactionIDs, fluxes, referenceFluxes)

DESCRIPTION ^

 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)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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 %Check if all variables are of the correct dimension
0021 if length(reactionIDs)~=length(fluxes) || length(reactionIDs)~=length(referenceFluxes)
0022     returnPathway=pathway;
0023     errorFlag=1;
0024     fprintf('reactionIDs, fluxes, and referenceFluxes do not have the same number of elements.');
0025     return;
0026 end
0027 
0028 %Loop through the components in the pathway. Check if any component has a
0029 %note and then check for the corresponding reaction id
0030 returnPathway=pathway;
0031 
0032 for i=1:length(pathway.listOfSpecies)
0033     if strcmpi(pathway.listOfSpecies(i).type,'PROTEIN')
0034         if isfield(pathway.listOfSpecies(i),'note')
0035             if ~isempty(pathway.listOfSpecies(i).note)
0036                 %If there is a note check if there is a corresponding
0037                 %reaction id
0038                 index=find(strcmpi(reactionIDs,pathway.listOfSpecies(i).note));
0039                 %If there is a match
0040                 if any(index)
0041                     returnPathway.listOfSpecies(i).flux=fluxes(index);
0042                     returnPathway.listOfSpecies(i).referenceFlux=referenceFluxes(index);
0043                 end
0044             end
0045         end
0046     end
0047 end
0048 end

Generated by m2html © 2005