def getPgfamDistribution(genomeGenePgfamList):
    """ Given list of genome-gene-pgfam tuples, 
        tabulate counts per genome per pgfam, 
        num duplications per pgfam, 
        num single-copy.
        This information can be used to identify PGFams suitable for phylogenetic inference for these genomes.
        Alternatively, can use to identify genomes with sparse single-copy coverage to remove to create denser phylogenetic matrix. 
    """
    ggpMat = {} # genome-gene-pgfam matrix (really just a dictionary)
    for row in genomeGenePgfamList:
        genome, gene, pgfam = row
        if pgfam not in ggpMat:
            ggpMat[pgfam] = {}
        if genome not in ggpMat[pgfam]:
            ggpMat[pgfam][genome] = []
        ggpMat[pgfam][genome].append(gene)
    return ggpMat