def getCombinations(matrix, phenome, genome, pthresh, gthresh):
    """
    Generator to combination of compounds and pathways data
    """
    phenome = sorted(filter(lambda x: x[3] >= pthresh, phenome), key=lambda
        x: x[3], reverse=True)
    genome = sorted(filter(lambda x: x[2] >= 0, genome), key=lambda x: x[2])
    toRemove = []
    for j in genome:
        p = j[0]
        bOne = False
        for i in phenome:
            cid = i[0]
            scateg = i[1]
            if p in matrix[cid][scateg]:
                bOne = True
                break
        if not bOne:
            toRemove.append(j)
    for i in toRemove:
        genome.remove(i)
    out = []
    for i in phenome:
        cid = i[0]
        scateg = i[1]
        cname = i[2]
        pval = i[3]
        for j in genome:
            p = j[0]
            pname = j[1]
            gval = j[2]
            if p in matrix[cid][scateg]:
                out.append((scateg, cid, cname, p, pname, pval, gval))
    for o in sorted(out, key=lambda x: (x[5], x[6]), reverse=True):
        yield o
