scout/utils/link.py
def add_ensembl_info(genes, ensembl_lines):
    """Add the coordinates from ensembl
    
    Args:
        genes(dict): Dictionary with all genes
        ensembl_lines(iteable): Iteable with raw ensembl info
    """
    
    LOG.info("Adding ensembl coordinates")
    # Parse and add the ensembl gene info
    if isinstance(ensembl_lines, DataFrame):
        ensembl_genes = parse_ensembl_gene_request(ensembl_lines)
    else:
        ensembl_genes = parse_ensembl_genes(ensembl_lines)

    for ensembl_gene in ensembl_genes:
        gene_obj = genes.get(ensembl_gene['hgnc_id'])
        if not gene_obj:
            continue
        gene_obj['chromosome'] = ensembl_gene['chrom']
        gene_obj['start'] = ensembl_gene['gene_start']
        gene_obj['end'] = ensembl_gene['gene_end']
        # ensembl ids can differ between builds. There is one stated in HGNC
        # that is true for build 38. So we add information from ensembl
        gene_obj['ensembl_gene_id'] = ensembl_gene['ensembl_gene_id']
def add_ensembl_info(genes, ensembl_lines):
    """Add the coordinates from ensembl
    
    Args:
        genes(dict): Dictionary with all genes
        ensembl_lines(iteable): Iteable with raw ensembl info
    """
    
    LOG.info("Adding ensembl coordinates")
    # Parse and add the ensembl gene info
    if isinstance(ensembl_lines, DataFrame):
        ensembl_genes = parse_ensembl_gene_request(ensembl_lines)
    else:
        ensembl_genes = parse_ensembl_genes(ensembl_lines)

    for ensembl_gene in ensembl_genes:
        gene_obj = genes.get(ensembl_gene['hgnc_id'])
        if not gene_obj:
            continue
        gene_obj['chromosome'] = ensembl_gene['chrom']
        gene_obj['start'] = ensembl_gene['gene_start']
        gene_obj['end'] = ensembl_gene['gene_end']
        # ensembl ids can differ between builds. There is one stated in HGNC
        # that is true for build 38. So we add information from ensembl
        gene_obj['ensembl_gene_id'] = ensembl_gene['ensembl_gene_id']
def add_ensembl_info ( genes , ensembl_lines ) : LOG . info ( "Adding ensembl coordinates" ) # Parse and add the ensembl gene info if isinstance ( ensembl_lines , DataFrame ) : ensembl_genes = parse_ensembl_gene_request ( ensembl_lines ) else : ensembl_genes = parse_ensembl_genes ( ensembl_lines ) for ensembl_gene in ensembl_genes : gene_obj = genes . get ( ensembl_gene [ 'hgnc_id' ] ) if not gene_obj : continue gene_obj [ 'chromosome' ] = ensembl_gene [ 'chrom' ] gene_obj [ 'start' ] = ensembl_gene [ 'gene_start' ] gene_obj [ 'end' ] = ensembl_gene [ 'gene_end' ] # ensembl ids can differ between builds. There is one stated in HGNC # that is true for build 38. So we add information from ensembl gene_obj [ 'ensembl_gene_id' ] = ensembl_gene [ 'ensembl_gene_id' ]
Add the coordinates from ensembl
    
    Args:
        genes(dict): Dictionary with all genes
        ensembl_lines(iteable): Iteable with raw ensembl info
Add the coordinates from ensembl Args : genes ( dict ) : Dictionary with all genes ensembl_lines ( iteable ) : Iteable with raw ensembl info