Home > pathway > mapPathwayRxnNames.m

mapPathwayRxnNames

PURPOSE ^

mapPathwayRxnNames

SYNOPSIS ^

function [pathway, notMapped]=mapPathwayRxnNames(pathway,originalLabels,newLabels)

DESCRIPTION ^

 mapPathwayRxnNames
   For mapping labels in the pathway object. Useful if you want to change
   what is shown in the reaction boxes.

   pathway         pathway structure representing the pathway to be drawn
   originalLabels  cell array with the original reaction labels
   newLabels       cell array with the new reaction labels

   pathway         an updated pathway structure
   notMapped       a cell array with labels that could not be found in the
                   pathway object

   Usage: [pathway, notMapped]=mapPathwayRxnNames(pathway,originalLabels,newLabels)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [pathway, notMapped]=mapPathwayRxnNames(pathway,originalLabels,newLabels)
0002 % mapPathwayRxnNames
0003 %   For mapping labels in the pathway object. Useful if you want to change
0004 %   what is shown in the reaction boxes.
0005 %
0006 %   pathway         pathway structure representing the pathway to be drawn
0007 %   originalLabels  cell array with the original reaction labels
0008 %   newLabels       cell array with the new reaction labels
0009 %
0010 %   pathway         an updated pathway structure
0011 %   notMapped       a cell array with labels that could not be found in the
0012 %                   pathway object
0013 %
0014 %   Usage: [pathway, notMapped]=mapPathwayRxnNames(pathway,originalLabels,newLabels)
0015 
0016 if numel(originalLabels)~=numel(newLabels)
0017     EM='The new label cell array must have the same length as the old label cell array';
0018     dispEM(EM);
0019 end
0020 
0021 mapped=false(numel(originalLabels),1);
0022 
0023 for i=1:numel(pathway.listOfSpecies)
0024     if strcmpi(pathway.listOfSpecies(i).type,'PROTEIN')
0025         I=find(ismember(originalLabels,pathway.listOfSpecies(i).name));
0026         if any(I)
0027             if numel(I)==1
0028                 pathway.listOfSpecies(i).name=newLabels{I};
0029                 mapped(I)=true;
0030             else
0031                 EM=['The label "' pathway.listOfSpecies(i).name '" was found in several positions in oldLabels'];
0032                 dispEM(EM);
0033             end
0034         end
0035     end
0036 end
0037 
0038 notMapped=originalLabels(~mapped);
0039 end

Generated by m2html © 2005