1 from itertools import imap
2 from obitools import utils
3
4 from obitools.ecotag import EcoTagResult
7
8 @staticmethod
10 x = int(x)
11 if x < 0:
12 return None
13 else:
14 return x
15
16 @staticmethod
18 if x=='--':
19 return None
20 else:
21 return x
22
23 @staticmethod
25 if x=='--':
26 return None
27 else:
28 return float(x)
29
30 @staticmethod
32 if x=='--':
33 return None
34 else:
35 return int(x)
36
37
39 utils.ColumnFile.__init__(self,
40 stream, '\t', True,
41 (str,str,str,
42 EcoTagFileIterator.value,
43 EcoTagFileIterator.value,
44 EcoTagFileIterator.value,
45 EcoTagFileIterator.count,
46 EcoTagFileIterator.count,
47 EcoTagFileIterator.taxid,
48 EcoTagFileIterator.scientificName,
49 str,
50 EcoTagFileIterator.taxid,
51 EcoTagFileIterator.scientificName,
52 EcoTagFileIterator.taxid,
53 EcoTagFileIterator.scientificName,
54 EcoTagFileIterator.taxid,
55 EcoTagFileIterator.scientificName,
56 str
57 ))
58 self._memory=None
59
60 _colname = ['identification',
61 'seqid',
62 'best_match_ac',
63 'max_identity',
64 'min_identity',
65 'theorical_min_identity',
66 'count',
67 'match_count',
68 'taxid',
69 'scientific_name',
70 'rank',
71 'order_taxid',
72 'order_sn',
73 'family_taxid',
74 'family_sn',
75 'genus_taxid',
76 'genus_sn',
77 'species_taxid',
78 'species_sn',
79 'sequence']
80
106
108 for x in ecoTagIterator:
109 if x['identification']=='ID':
110 yield x
111
114
115 _colname = ['scientific_name',
116 'taxid',
117 'rank',
118 'count',
119 'max_identity',
120 'min_identity']
121
122
123 @staticmethod
125 x = int(x)
126 if x < 0:
127 return None
128 else:
129 return x
130
132 utils.ColumnFile.__init__(self,
133 stream, '\t', True,
134 (str,
135 EcoTagFileIterator.taxid,
136 str,
137 int,
138 float,float,float))
139
145
147 for x in ecoTagAbsIterator:
148 if x['taxid'] is not None:
149 yield x
150