Exemplo n.º 1
0
def get_tcntobj(go2obj, **kws):
    """Return a TermCounts object if the user provides an annotation file, otherwise None."""
    # kws: gpad gaf gene2go id2gos
    objanno = get_objanno_g_kws(**kws)
    if objanno:
        return TermCounts(go2obj, objanno.get_id2gos_nss())
    return None
Exemplo n.º 2
0
def read_annotations(**kws):
    """Read annotations from either a GAF file or NCBI's gene2go file."""
    # Read and save annotation lines
    objanno = get_objanno_g_kws(**kws)
    # Return associations
    return objanno.get_id2gos() if objanno is not None else {}