def _count_genes(pg_data: dict) -> dict:
    """
    Calculate gene counts for a pangenome object
    Args:
        pg_data: workspace data object for the Pangenome
    Returns:
        Dict of counts with the GeneFamilyReport type in PanGenomeAPI.spec
    """
    counts = {
        "genes_count": 0,
        "homolog_family_genes_count": 0,
        "singleton_family_genes_count": 0,
    }
    for family in pg_data["orthologs"]:
        count = len(family["orthologs"])
        counts["genes_count"] += count
        if count == 1:
            counts["singleton_family_genes_count"] += count
        elif count > 1:
            counts["homolog_family_genes_count"] += count
    return counts