scout/utils/requests.py
def fetch_ensembl_genes(build='37'):
    """Fetch the ensembl genes
    
    Args:
        build(str): ['37', '38']
    """
    if build == '37':
        url = 'http://grch37.ensembl.org'
    else:
        url = 'http://www.ensembl.org'
    
    LOG.info("Fetching ensembl genes from %s", url)
    dataset_name = 'hsapiens_gene_ensembl'
    
    dataset = pybiomart.Dataset(name=dataset_name, host=url)
    
    attributes = [
        'chromosome_name',
        'start_position',
        'end_position',
        'ensembl_gene_id',
        'hgnc_symbol',
        'hgnc_id',
    ]
    
    filters = {
        'chromosome_name': CHROMOSOMES,
    }
    
    result = dataset.query(
        attributes = attributes,
        filters = filters,
        use_attr_names=True,
    )
    
    return result
def fetch_ensembl_genes(build='37'):
    """Fetch the ensembl genes
    
    Args:
        build(str): ['37', '38']
    """
    if build == '37':
        url = 'http://grch37.ensembl.org'
    else:
        url = 'http://www.ensembl.org'
    
    LOG.info("Fetching ensembl genes from %s", url)
    dataset_name = 'hsapiens_gene_ensembl'
    
    dataset = pybiomart.Dataset(name=dataset_name, host=url)
    
    attributes = [
        'chromosome_name',
        'start_position',
        'end_position',
        'ensembl_gene_id',
        'hgnc_symbol',
        'hgnc_id',
    ]
    
    filters = {
        'chromosome_name': CHROMOSOMES,
    }
    
    result = dataset.query(
        attributes = attributes,
        filters = filters,
        use_attr_names=True,
    )
    
    return result
def fetch_ensembl_genes ( build = '37' ) : if build == '37' : url = 'http://grch37.ensembl.org' else : url = 'http://www.ensembl.org' LOG . info ( "Fetching ensembl genes from %s" , url ) dataset_name = 'hsapiens_gene_ensembl' dataset = pybiomart . Dataset ( name = dataset_name , host = url ) attributes = [ 'chromosome_name' , 'start_position' , 'end_position' , 'ensembl_gene_id' , 'hgnc_symbol' , 'hgnc_id' , ] filters = { 'chromosome_name' : CHROMOSOMES , } result = dataset . query ( attributes = attributes , filters = filters , use_attr_names = True , ) return result
Fetch the ensembl genes
    
    Args:
        build(str): ['37', '38']
Fetch the ensembl genes Args : build ( str ) : [ 37 38 ]