def add_match_to_profile(profile, match, ismap=True, nucl=None):
    """Merge current read-gene matches to master profile.

    Parameters
    ----------
    profile : dict
        Master gene profile.
    match : dict
        Read-gene matches.
    ismap : bool, optional
        Whether matches are a read-to-gene(s) map or simple counts.
    nucl : str, optional
        Prefix nucleotide Id to gene Ids.

    See Also
    --------
    match_read_gene
    """
    # prefix gene Id with nucleotide Id
    def prefix(gene):
        return '{}_{}'.format(nucl, gene) if nucl else gene

    # read-to-gene(s) map
    if ismap:
        for ridx, genes in match.items():
            for gene in genes:
                profile.setdefault(prefix(gene), []).append(ridx)

    # simple counts
    else:
        for gene, count in match.items():
            gene = prefix(gene)
            profile[gene] = profile.get(gene, 0) + count