def _process_record(self, record_id):
'''
Process the next sequence: run the genetic, abundance, and distribution checks, either
merging the sequence into an existing OTU or creating a new OTU.
'''
assert record_id in self.seq_table.index
record = self.records[record_id]
candidate = OTU(record.id, str(record.seq), self.seq_table.loc[record.id])
if self.log is not None:
print('seq', candidate.name, sep='\t', file=self.log)
merged = False
for otu in self.ga_matches(candidate):
test_pval = candidate.distribution_pval(otu)
if self.log is not None:
print(candidate.name, 'distribution_check', otu.name, test_pval, sep='\t', file=self.log)
if test_pval > self.threshold_pval:
otu.absorb(candidate)
self.membership[otu.name].append(candidate.name)
merged = True
break
if not merged:
# form own otu
self.otus.append(candidate)
self.membership[candidate.name] = [candidate.name]
评论列表
文章目录