def _join_pheno_with_famfile(famfile_this, pheno_tab):
    """
    Helper function to join an ancestry-specific famfile with a phenotype ht.
    """
    famfile_this = famfile_this.add_index('idx').key_by('IID')
    famfile_pheno = famfile_this.join(pheno_tab, how='left')
    famfile_pheno = famfile_pheno.key_by('idx').order_by('idx').drop('idx')
    return famfile_pheno