def _init_taxid2asscs(self):
        """Create dict with taxid keys and annotation namedtuple list."""
        taxid2asscs = cx.defaultdict(list)
        for ntanno in self.associations:
            taxid2asscs[ntanno.tax_id].append(ntanno)
        assert len(taxid2asscs) != 0, "**FATAL: NO TAXIDS: {F}".format(F=self.filename)
        # """Print the number of taxids stored."""
        prt = sys.stdout
        num_taxids = len(taxid2asscs)
        prt.write('{N} taxids stored'.format(N=num_taxids))
        if num_taxids < 5:
            prt.write(': {Ts}'.format(Ts=' '.join(sorted(str(t) for t in taxid2asscs))))
        prt.write('\n')
        return dict(taxid2asscs)
def _init_taxid2asscs ( self ) : taxid2asscs = cx . defaultdict ( list ) for ntanno in self . associations : taxid2asscs [ ntanno . tax_id ] . append ( ntanno ) assert len ( taxid2asscs ) != 0 , "**FATAL: NO TAXIDS: {F}" . format ( F = self . filename ) prt = sys . stdout num_taxids = len ( taxid2asscs ) prt . write ( '{N} taxids stored' . format ( N = num_taxids ) ) if num_taxids < 5 : prt . write ( ': {Ts}' . format ( Ts = ' ' . join ( sorted ( str ( t ) for t in taxid2asscs ) ) ) ) prt . write ( '\n' ) return dict ( taxid2asscs )
Create dict with taxid keys and annotation namedtuple list.