scout/parse/panel.py
def parse_panel_app_gene(app_gene, hgnc_map):
    """Parse a panel app formated gene
    
    Args:
        app_gene(dict): Dict with panel app info
        hgnc_map(dict): Map from hgnc_symbol to hgnc_id
    
    Returns:
        gene_info(dict): Scout infromation
    """
    gene_info = {}
    confidence_level = app_gene['LevelOfConfidence']
    # Return empty gene if not confident gene
    if not confidence_level == 'HighEvidence':
        return gene_info
    
    hgnc_symbol = app_gene['GeneSymbol']
    # Returns a set of hgnc ids
    hgnc_ids = get_correct_ids(hgnc_symbol, hgnc_map)
    if not hgnc_ids:
        LOG.warning("Gene %s does not exist in database. Skipping gene...", hgnc_symbol)
        return gene_info
    
    if len(hgnc_ids) > 1:
        LOG.warning("Gene %s has unclear identifier. Choose random id", hgnc_symbol)

    gene_info['hgnc_symbol'] = hgnc_symbol
    for hgnc_id in hgnc_ids:
        gene_info['hgnc_id'] = hgnc_id

    gene_info['reduced_penetrance'] = INCOMPLETE_PENETRANCE_MAP.get(app_gene['Penetrance'])

    inheritance_models = []
    for model in MODELS_MAP.get(app_gene['ModeOfInheritance'],[]):
        inheritance_models.append(model)
    
    gene_info['inheritance_models'] = inheritance_models
    
    return gene_info
def parse_panel_app_gene(app_gene, hgnc_map):
    """Parse a panel app formated gene
    
    Args:
        app_gene(dict): Dict with panel app info
        hgnc_map(dict): Map from hgnc_symbol to hgnc_id
    
    Returns:
        gene_info(dict): Scout infromation
    """
    gene_info = {}
    confidence_level = app_gene['LevelOfConfidence']
    # Return empty gene if not confident gene
    if not confidence_level == 'HighEvidence':
        return gene_info
    
    hgnc_symbol = app_gene['GeneSymbol']
    # Returns a set of hgnc ids
    hgnc_ids = get_correct_ids(hgnc_symbol, hgnc_map)
    if not hgnc_ids:
        LOG.warning("Gene %s does not exist in database. Skipping gene...", hgnc_symbol)
        return gene_info
    
    if len(hgnc_ids) > 1:
        LOG.warning("Gene %s has unclear identifier. Choose random id", hgnc_symbol)

    gene_info['hgnc_symbol'] = hgnc_symbol
    for hgnc_id in hgnc_ids:
        gene_info['hgnc_id'] = hgnc_id

    gene_info['reduced_penetrance'] = INCOMPLETE_PENETRANCE_MAP.get(app_gene['Penetrance'])

    inheritance_models = []
    for model in MODELS_MAP.get(app_gene['ModeOfInheritance'],[]):
        inheritance_models.append(model)
    
    gene_info['inheritance_models'] = inheritance_models
    
    return gene_info
def parse_panel_app_gene ( app_gene , hgnc_map ) : gene_info = { } confidence_level = app_gene [ 'LevelOfConfidence' ] # Return empty gene if not confident gene if not confidence_level == 'HighEvidence' : return gene_info hgnc_symbol = app_gene [ 'GeneSymbol' ] # Returns a set of hgnc ids hgnc_ids = get_correct_ids ( hgnc_symbol , hgnc_map ) if not hgnc_ids : LOG . warning ( "Gene %s does not exist in database. Skipping gene..." , hgnc_symbol ) return gene_info if len ( hgnc_ids ) > 1 : LOG . warning ( "Gene %s has unclear identifier. Choose random id" , hgnc_symbol ) gene_info [ 'hgnc_symbol' ] = hgnc_symbol for hgnc_id in hgnc_ids : gene_info [ 'hgnc_id' ] = hgnc_id gene_info [ 'reduced_penetrance' ] = INCOMPLETE_PENETRANCE_MAP . get ( app_gene [ 'Penetrance' ] ) inheritance_models = [ ] for model in MODELS_MAP . get ( app_gene [ 'ModeOfInheritance' ] , [ ] ) : inheritance_models . append ( model ) gene_info [ 'inheritance_models' ] = inheritance_models return gene_info
Parse a panel app formated gene
    
    Args:
        app_gene(dict): Dict with panel app info
        hgnc_map(dict): Map from hgnc_symbol to hgnc_id
    
    Returns:
        gene_info(dict): Scout infromation
Parse a panel app formated gene Args : app_gene ( dict ) : Dict with panel app info hgnc_map ( dict ) : Map from hgnc_symbol to hgnc_id Returns : gene_info ( dict ) : Scout infromation