Team:Alberta/Project/Modeling/FindMatches

From 2009.igem.org

(Difference between revisions)
(New page: %Finds the number of elements in List2 that match with %any other element in List1. Also makes a new list consisting of those %matches from List2. (It does not make a difference which...)
Line 1: Line 1:
-
  %Finds the number of elements in List2 that match with
+
 
-
%any other element in List1.  Also makes a new list consisting of those
+
  %Finds the number of elements in List2 that match with any other element in List1.  Also makes a new list consisting of those
-
  %matches from List2.  (It does not make a difference which list is which unless there
+
  %matches from List2.  (It does not make a difference which list is which unless there are repeats in a single list.)
-
%are repeats in a single list).
+
   
   
  function [ListOfMatches, NumberOfMatches] = FindMatches(List1,List2)
  function [ListOfMatches, NumberOfMatches] = FindMatches(List1,List2)
   
   
-
  %example: List1 = invertedGeneListArray{z}; or List1 = literatureGenes;
+
  correlation = FindMatches(LiteratureGenes, model.genes)
-
%example: List2 = SuspectedEssentialGenes;  or List2 = model.genes;
+
   
   
  r=1;
  r=1;

Revision as of 01:07, 18 October 2009

%Finds the number of elements in List2 that match with any other element in List1.  Also makes a new list consisting of those
%matches from List2.  (It does not make a difference which list is which unless there are repeats in a single list.)

function [ListOfMatches, NumberOfMatches] = FindMatches(List1,List2)

correlation = FindMatches(LiteratureGenes, model.genes)

r=1;
MatchList=cell(1);
Match=zeros(size(List1));

for a=(1:length(List1))
    for b=(1:length(List2))
        if strcmp(List1(a), List2(b)) == 1
            Match(b)=1;
        end
    end
end

for c=1:length(List2)
    if Match(c)==1
        MatchList(r)=List2(c);
        r=r+1;
    end
end
ListOfMatches=MatchList';
NumberOfMatches=sum(Match);