Download association from http://geneontology.org/gene-associations.

def dnld_assc(assc_name, go2obj=None, prt=sys.stdout):
    """Download association from http://geneontology.org/gene-associations."""
    # Example assc_name: "tair.gaf"
    # Download the Association
    dirloc, assc_base = os.path.split(assc_name)
    if not dirloc:
        dirloc = os.getcwd()
    assc_locfile = os.path.join(dirloc, assc_base) if not dirloc else assc_name
    dnld_annotation(assc_locfile, prt)
    # Read the downloaded association
    assc_orig = read_gaf(assc_locfile, prt)
    if go2obj is None:
        return assc_orig
    # If a GO DAG is provided, use only GO IDs present in the GO DAG
    assc = {}
    goids_dag = set(go2obj.keys())
    for gene, goids_cur in assc_orig.items():
        assc[gene] = goids_cur.intersection(goids_dag)
    return assc