-
Notifications
You must be signed in to change notification settings - Fork 0
/
KEGGIDAnnotations.m
17 lines (17 loc) · 1.05 KB
/
KEGGIDAnnotations.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function [AmodelAddedKEGG]=KEGGIDAnnotations(Amodel,TabDelimFile,Row,Hits,MetPos)
%If you want to customize the type of annotation in this function, you have to
%change the Regular Expression in the next line to a pattern of your desire.
StrSearchCell=regexp(TabDelimFile(Row(Hits),:),'(C[0-9]{5}?)');
StrSearchArray = ~cellfun(@isempty,StrSearchCell);
TargetCellInRow= find(StrSearchArray);
if ~isempty(TargetCellInRow)
%Don't forget to alter or comment out the next line if
%you have customized the type of annotation you are
%looking for above.
FoundStr=regexprep(TabDelimFile{Row(Hits),TargetCellInRow},'.*(C[0-9]{5}?).*','$1');
%Remember to change the target cell array to match the
%customized annotation (Amodel.MetCustomAnnotation)
Amodel.metKEGGID(MetPos,1)=cellstr(FoundStr);
end
AmodelAddedKEGG=Amodel;
end