2
4 '''
5 DistanceMatrix constructor.
6
7 @param alignment: aligment used to compute distance matrix
8 @type alignment: obitools.align.Alignment
9 '''
10 self.aligment = alignment
11 self.matrix = [[None] * (x+1) for x in xrange(len(alignment))]
12
14 raise NotImplementedError
15
17 assert isinstance(key,(tuple,list)) and len(key)==2, \
18 'key must be a tuple or a list of two integers'
19 x,y = key
20 if y < x:
21 z=x
22 x=y
23 y=z
24 rep = self.matrix[y][x]
25 if rep is None:
26 rep = self.evaluateDist(x,y)
27 self.matrix[y][x] = rep
28
29 return rep
30