scout/server/blueprints/variants/controllers.py
def get_predictions(genes):
    """Get sift predictions from genes."""
    data = {
        'sift_predictions': [],
        'polyphen_predictions': [],
        'region_annotations': [],
        'functional_annotations': []
    }
    for gene_obj in genes:
        for pred_key in data:
            gene_key = pred_key[:-1]
            if len(genes) == 1:
                value = gene_obj.get(gene_key, '-')
            else:
                gene_id = gene_obj.get('hgnc_symbol') or str(gene_obj['hgnc_id'])
                value = ':'.join([gene_id, gene_obj.get(gene_key, '-')])
            data[pred_key].append(value)

    return data
def get_predictions(genes):
    data = {
        'sift_predictions': [],
        'polyphen_predictions': [],
        'region_annotations': [],
        'functional_annotations': []
    }
    for gene_obj in genes:
        for pred_key in data:
            gene_key = pred_key[:-1]
            if len(genes) == 1:
                value = gene_obj.get(gene_key, '-')
            else:
                gene_id = gene_obj.get('hgnc_symbol') or str(gene_obj['hgnc_id'])
                value = ':'.join([gene_id, gene_obj.get(gene_key, '-')])
            data[pred_key].append(value)

    return data
def get_predictions ( genes ) : data = { 'sift_predictions' : [ ] , 'polyphen_predictions' : [ ] , 'region_annotations' : [ ] , 'functional_annotations' : [ ] } for gene_obj in genes : for pred_key in data : gene_key = pred_key [ : - 1 ] if len ( genes ) == 1 : value = gene_obj . get ( gene_key , '-' ) else : gene_id = gene_obj . get ( 'hgnc_symbol' ) or str ( gene_obj [ 'hgnc_id' ] ) value = ':' . join ( [ gene_id , gene_obj . get ( gene_key , '-' ) ] ) data [ pred_key ] . append ( value ) return data
Get sift predictions from genes.
Get sift predictions from genes .