1 from obitools import BioSequence
2
4
6 assert isinstance(data, BioSequence),'You must only add bioseq to an alignement'
7 if hasattr(self, '_alignlen'):
8 assert self._alignlen==len(data),'All aligned sequences must have the same length'
9 else:
10 self._alignlen=len(data)
11 return data
12
16
21
23 if isinstance(key,int):
24 return [x[key] for x in self]
25
27 return reduce(lambda x,y: x and y,(z=='-' for z in self.getSite(key)),True)
28
30 return reduce(lambda x,y: x or y,(z=='-' for z in self.getSite(key)),False)
31
33 seqs = sequenceIterator(file)
34 alignement = Alignement()
35 for seq in seqs:
36 alignement.append(seq)
37 return alignement
38