Home > FR3DSource > zDistanceToExemplars.m

zDistanceToExemplars

PURPOSE ^

zDistanceToExemplars(Exemplar,Pair) computes the distance to each

SYNOPSIS ^

function [c,d,f,g,i] = zDistanceToExemplars(Exemplar,NT1,NT2)

DESCRIPTION ^

 zDistanceToExemplars(Exemplar,Pair) computes the distance to each
 exemplar for the given pair of nucleotides

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % zDistanceToExemplars(Exemplar,Pair) computes the distance to each
0002 % exemplar for the given pair of nucleotides
0003 
0004 function [c,d,f,g,i] = zDistanceToExemplars(Exemplar,NT1,NT2)
0005 
0006 pc = 4*(NT2.Code-1) + NT1.Code;     % AA is 1, CA is 2, etc.
0007 
0008 k = 1;
0009 
0010 F2.NT(1) = NT1;
0011 F2.NT(2) = NT2;
0012 
0013 for j = 1:length(Exemplar(:,pc)),
0014   E = Exemplar(j,pc);
0015   if ~isempty(Exemplar(j,pc).Class),
0016     c(k) = E.Class;
0017     d(k) = sqrt(xDiscrepancyFast(E,[NT1 NT2]))/2;
0018     f(k) = j;
0019     g(k) = pc;
0020   else
0021     c(k) = 99;
0022     d(k) = 99999999;
0023     f(k) = 1;               % fictitious
0024     g(k) = 1;               % fictitious
0025   end
0026   k = k + 1;
0027 end
0028 
0029 [a,i] = sort(d);
0030 
0031 c = c(i);
0032 d = d(i);
0033 f = f(i);
0034 g = g(i);

Generated on Fri 03-Apr-2009 09:52:35 by m2html © 2003