Team:Alberta/Project/Modeling/FindMatchesArray

From 2009.igem.org

(Difference between revisions)
(New page: function [MatchListArray, Diff, minimumDiff, positionOfMinimumDiff] = FindMatchesArray(List, CellArrayOfLists) %example: CellArrayOfLists = MinimalGenomeArray; %example: List = YourSusp...)
 
Line 1: Line 1:
-
  function [MatchListArray, Diff, minimumDiff, positionOfMinimumDiff] = FindMatchesArray(List, CellArrayOfLists)
+
 +
  function [MatchListArray, Diff, minimumDiff, positionOfMinimumDiff] = FindMatchListArray(List, CellArrayOfLists)
  %example: CellArrayOfLists = MinimalGenomeArray;
  %example: CellArrayOfLists = MinimalGenomeArray;
-
  %example: List = YourSuspectedResearchedLiteratureEssentialGenes; (or your suspected minimal genome)
+
  %example: List = YourSuspectedResearchedLiteratureEssentialGenes; (or your
 +
%suspected minimal genome)
  %If the lists were chosen in this way, the Researched List would be compared with every
  %If the lists were chosen in this way, the Researched List would be compared with every
  %Minimal Genome list one at a time.  For each comparison, this code
  %Minimal Genome list one at a time.  For each comparison, this code
Line 33: Line 35:
     end
     end
      
      
-
     MatchList=MatchList'       ;
+
     MatchList=MatchList';
     %NumberOfMatches=sum(Match) %sum(Match) not MatchList
     %NumberOfMatches=sum(Match) %sum(Match) not MatchList
   
   
Line 51: Line 53:
  disp('Use InvertList.m on the researched essential genes and the MatchListArray entry that has the smallest difference')
  disp('Use InvertList.m on the researched essential genes and the MatchListArray entry that has the smallest difference')
  disp('Or use InverListArray.m on the researched essential genes and the whole MatchListArray')
  disp('Or use InverListArray.m on the researched essential genes and the whole MatchListArray')
 +
disp('It would output what genes the model is suggesting should be included in the researched list')

Latest revision as of 02:04, 18 October 2009

function [MatchListArray, Diff, minimumDiff, positionOfMinimumDiff] = FindMatchListArray(List, CellArrayOfLists)
%example: CellArrayOfLists = MinimalGenomeArray;
%example: List = YourSuspectedResearchedLiteratureEssentialGenes; (or your
%suspected minimal genome)
%If the lists were chosen in this way, the Researched List would be compared with every
%Minimal Genome list one at a time.  For each comparison, this code
%would output (for this example) the list of matches and lets you know which
%list you should analyze further to improve your researched gene list.
Diff=zeros(1);
MatchListArray=cell(1);

for z=1:length(CellArrayOfLists)
z
    r=1;
    MatchList=cell(1);

    Match=zeros(max(length(CellArrayOfLists{z}), length(List)));

    for a=(1:length(CellArrayOfLists{z}))
        for b=(1:length(List))
            if strcmp(CellArrayOfLists{z}(a), List(b)) == 1
                Match(b)=1;
            end
        end
        a;
    end


    for c=1:length(List)
        if Match(c) == 1
            MatchList(r) = List(c);
            r=r+1;
        end
    end
    
    MatchList=MatchList';
    %NumberOfMatches=sum(Match) %sum(Match) not MatchList

    MatchListArray{z}=MatchList
end


for t=1:length(CellArrayOfLists)
    Diff(t)=length(CellArrayOfLists{t})-length(MatchListArray{t});
end
Diff
 
[minimumDiff, positionOfMinimumDiff] = min(Diff)

[maxValue minValue avg minPosition] = MaxMinAvg(MatchListArray)

disp('Use InvertList.m on the researched essential genes and the MatchListArray entry that has the smallest difference')
disp('Or use InverListArray.m on the researched essential genes and the whole MatchListArray')
disp('It would output what genes the model is suggesting should be included in the researched list')