scout/parse/panel.py
def get_omim_panel_genes(genemap2_lines, mim2gene_lines, alias_genes):
    """Return all genes that should be included in the OMIM-AUTO panel
    Return the hgnc symbols
    
    Genes that have at least one 'established' or 'provisional' phenotype connection
    are included in the gene panel
    
    Args:
        genemap2_lines(iterable)
        mim2gene_lines(iterable)
        alias_genes(dict): A dictionary that maps hgnc_symbol to hgnc_id
    
    Yields:
        hgnc_symbol(str)
    """
    parsed_genes = get_mim_genes(genemap2_lines, mim2gene_lines)
    
    STATUS_TO_ADD = set(['established', 'provisional'])
    
    for hgnc_symbol in parsed_genes:
        try:
            gene = parsed_genes[hgnc_symbol]
            keep = False
            for phenotype_info in gene.get('phenotypes',[]):
                if phenotype_info['status'] in STATUS_TO_ADD:
                    keep = True
                    break
            if keep:
                hgnc_id_info = alias_genes.get(hgnc_symbol)
                if not hgnc_id_info:
                    for symbol in gene.get('hgnc_symbols', []):
                        if symbol in alias_genes:
                            hgnc_id_info = alias_genes[symbol]
                            break

                if hgnc_id_info:
                    yield {
                    'hgnc_id': hgnc_id_info['true'],
                    'hgnc_symbol': hgnc_symbol,
                    }
                else:
                    LOG.warning("Gene symbol %s does not exist", hgnc_symbol)
                    
        except KeyError:
            pass
def get_omim_panel_genes(genemap2_lines, mim2gene_lines, alias_genes):
    """Return all genes that should be included in the OMIM-AUTO panel
    Return the hgnc symbols
    
    Genes that have at least one 'established' or 'provisional' phenotype connection
    are included in the gene panel
    
    Args:
        genemap2_lines(iterable)
        mim2gene_lines(iterable)
        alias_genes(dict): A dictionary that maps hgnc_symbol to hgnc_id
    
    Yields:
        hgnc_symbol(str)
    """
    parsed_genes = get_mim_genes(genemap2_lines, mim2gene_lines)
    
    STATUS_TO_ADD = set(['established', 'provisional'])
    
    for hgnc_symbol in parsed_genes:
        try:
            gene = parsed_genes[hgnc_symbol]
            keep = False
            for phenotype_info in gene.get('phenotypes',[]):
                if phenotype_info['status'] in STATUS_TO_ADD:
                    keep = True
                    break
            if keep:
                hgnc_id_info = alias_genes.get(hgnc_symbol)
                if not hgnc_id_info:
                    for symbol in gene.get('hgnc_symbols', []):
                        if symbol in alias_genes:
                            hgnc_id_info = alias_genes[symbol]
                            break

                if hgnc_id_info:
                    yield {
                    'hgnc_id': hgnc_id_info['true'],
                    'hgnc_symbol': hgnc_symbol,
                    }
                else:
                    LOG.warning("Gene symbol %s does not exist", hgnc_symbol)
                    
        except KeyError:
            pass
Return all genes that should be included in the OMIM-AUTO panel
    Return the hgnc symbols
    
    Genes that have at least one 'established' or 'provisional' phenotype connection
    are included in the gene panel
    
    Args:
        genemap2_lines(iterable)
        mim2gene_lines(iterable)
        alias_genes(dict): A dictionary that maps hgnc_symbol to hgnc_id
    
    Yields:
        hgnc_symbol(str)