Home > pathway > colorPathway.m

colorPathway

PURPOSE ^

colorPathway

SYNOPSIS ^

function returnPathway = colorPathway(pathway, reactionIDs, fluxes, referenceFluxes,cutOff, defaultColor, upColor, downColor)

DESCRIPTION ^

 colorPathway
    Calculates the color for those reactions that should be marked in the
    map and returns an updated pathway structure.

   pathway         pathway structure of the metabolic network
   reactionsIDs    cell array with the names of the reactions in the model
   fluxes          vector with flux values from the simulation
   referenceFluxes vector with fluxes for the reference simulation
   cutOff          a reaction is only colored if the absolute value of 
                   at least one of the fluxes is above the cutoff value
                   (opt, default 0)
   defaultColor    a color in Matlab format to be used if there are no
                   changes between the fluxes. This color is also used to 
                   calculate the transition between the colors for up and
                   down regulated fluxes (opt, default [1 1 1])
   upColor         a color in Matlab format to be used if the flux is 
                   larger than the reference flux (opt, default [0 1 0])
   downColor       a color in Matlab format to be used if the flux is 
                   smaller than the reference flux (opt, default [1 0 0])

   returnPathway   updated pathway structure which contains coloring data
       color       array indicating the coloring of the enzyme
       signChange  true if the reaction has changed direction

    Usage: returnPathway = colorPathway(pathway, reactionIDs, fluxes, referenceFluxes, ...
           cutOff, defaultColor, upColor, downColor)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function returnPathway = colorPathway(pathway, reactionIDs, fluxes, referenceFluxes, ...
0002     cutOff, defaultColor, upColor, downColor)
0003 % colorPathway
0004 %    Calculates the color for those reactions that should be marked in the
0005 %    map and returns an updated pathway structure.
0006 %
0007 %   pathway         pathway structure of the metabolic network
0008 %   reactionsIDs    cell array with the names of the reactions in the model
0009 %   fluxes          vector with flux values from the simulation
0010 %   referenceFluxes vector with fluxes for the reference simulation
0011 %   cutOff          a reaction is only colored if the absolute value of
0012 %                   at least one of the fluxes is above the cutoff value
0013 %                   (opt, default 0)
0014 %   defaultColor    a color in Matlab format to be used if there are no
0015 %                   changes between the fluxes. This color is also used to
0016 %                   calculate the transition between the colors for up and
0017 %                   down regulated fluxes (opt, default [1 1 1])
0018 %   upColor         a color in Matlab format to be used if the flux is
0019 %                   larger than the reference flux (opt, default [0 1 0])
0020 %   downColor       a color in Matlab format to be used if the flux is
0021 %                   smaller than the reference flux (opt, default [1 0 0])
0022 %
0023 %   returnPathway   updated pathway structure which contains coloring data
0024 %       color       array indicating the coloring of the enzyme
0025 %       signChange  true if the reaction has changed direction
0026 %
0027 %    Usage: returnPathway = colorPathway(pathway, reactionIDs, fluxes, referenceFluxes, ...
0028 %           cutOff, defaultColor, upColor, downColor)
0029 
0030 if nargin<8
0031     downColor=[1 0 0];
0032 end
0033 if nargin<7
0034     upColor=[0 1 0];
0035 end
0036 if nargin<6
0037     defaultColor=[1 1 1];
0038 end
0039 if nargin<5
0040     cutOff=0;
0041 end
0042 
0043 %Loop through the components in the pathway. Check if any component has a
0044 %note and then check for the corresponding reaction id
0045 returnPathway=pathway;
0046 
0047 for i=1:length(pathway.listOfSpecies)
0048     if strcmpi(pathway.listOfSpecies(i).type,'PROTEIN')
0049         if isfield(pathway.listOfSpecies(i),'note')
0050             if ~isempty(pathway.listOfSpecies(i).note)
0051                 %If there is a note check if there is a corresponding
0052                 %reaction id
0053                 correspondingReaction=find(strcmpi(reactionIDs,pathway.listOfSpecies(i).note));
0054                 if correspondingReaction>0
0055                     %Check if either flux is above the cutoff value
0056                     if abs(referenceFluxes(correspondingReaction))>=cutOff ||...
0057                             abs(fluxes(correspondingReaction))>=cutOff
0058                         %Calculate the corresponding color
0059                         [color, signChange]=getColorCodes(referenceFluxes(correspondingReaction)...
0060                             ,fluxes(correspondingReaction),1 , defaultColor, upColor, downColor);
0061                         if ~isempty(color)
0062                             returnPathway.listOfSpecies(i).color=color{1,1};
0063                             returnPathway.listOfSpecies(i).signChange=signChange{1,1};
0064                         end
0065                     end
0066                 end
0067             end
0068         end
0069     end
0070 end
0071 end

Generated by m2html © 2005