Add alternate GO IDs to term counts.

def _init_add_goid_alt(self):
        '''
            Add alternate GO IDs to term counts.
        '''
        # Fill aspect_counts. Find alternate GO IDs that may not be on gocnts
        goid_alts = set()
        go2cnt_add = {}
        aspect_counts = self.aspect_counts
        gocnts = self.gocnts
        go2obj = self.go2obj
        for go_id, cnt in gocnts.items():
            goobj = go2obj[go_id]
            assert cnt, "NO TERM COUNTS FOR {GO}".format(GO=goobj.item_id)
            # Was the count set using an alternate GO?
            if go_id != goobj.item_id:
                go2cnt_add[goobj.item_id] = cnt
            goid_alts |= goobj.alt_ids
            # Group by namespace
            aspect_counts[goobj.namespace] += cnt
        # If alternate GO used to set count, add main GO ID
        for goid, cnt in go2cnt_add.items():
            gocnts[goid] = cnt
        # Add missing alt GO IDs to gocnts
        for alt_goid in goid_alts.difference(gocnts):
            goobj = go2obj[alt_goid]
            cnt = gocnts[goobj.item_id]
            assert cnt, "NO TERM COUNTS FOR ALT_ID({GOa}) ID({GO}): {NAME}".format(
                GOa=alt_goid, GO=goobj.item_id, NAME=goobj.name)
            gocnts[alt_goid] = cnt