Exemple #1
0
 def __init_go2nt_w_usr(self, gos_all, usr_go2nt, prt_flds_all):
     """Combine GO object fields and format_txt."""
     assert usr_go2nt, "go2nt HAS NO ELEMENTS"
     from goatools.nt_utils import get_unique_fields
     go2nts = [
         usr_go2nt, self.gosubdag.go2nt,
         self._get_go2nthdridx(gos_all)
     ]
     usr_nt_flds = next(iter(
         usr_go2nt.values()))._fields  # Get any single value from a dict
     flds = get_unique_fields([usr_nt_flds, prt_flds_all])
     go2nt = get_dict_w_id2nts(gos_all, go2nts, flds)
     return self._init_go2nt_aug(go2nt)
def run(fld_lists, expected):
    """Create unique field list. Check for PASS/FAIL."""
    actual = get_unique_fields(fld_lists)
    assert actual == expected, "ACTUAL({A}) != EXPECTED({E})".format(
        A=" ".join(actual), E=" ".join(expected))