def load_upid_gca_file(upid_gca_file):
    """
    Parses Uniprot's upid tsv file and exports all important information
    in json format

    upid_gca_file: UPID_GCA file provided by trembl

    returns: A dictionary of upid, gca and domain mappings {upid: {"GCA": , "DOM": }}
    """

    upid_gca_dict = {}
    upid_fp = open(upid_gca_file, 'r')

    try:
        for upid_line in upid_fp:
            upid_line = upid_line.strip().split('\t')

            # add GCA accession
            if upid_line[1] != '':
                upid_gca_dict[upid_line[0]] = {"GCA": upid_line[1]}
            else:
                upid_gca_dict[upid_line[0]] = {"GCA": -1}

            upid_gca_dict[upid_line[0]]["DOM"] = upid_line[2]

        upid_fp.close()

    except:
        raise IOError

    return upid_gca_dict