scout/utils/requests.py
def fetch_exac_constraint():
    """Fetch the file with exac constraint scores
    
    Returns:
        exac_lines(iterable(str))
    """
    file_name = 'fordist_cleaned_exac_r03_march16_z_pli_rec_null_data.txt' 
    url = ('ftp://ftp.broadinstitute.org/pub/ExAC_release/release0.3/functional_gene_constraint'
           '/{0}').format(file_name)
    
    LOG.info("Fetching ExAC genes")
    
    try:
        exac_lines = fetch_resource(url)
    except URLError as err:
        LOG.info("Failed to fetch exac constraint scores file from ftp server")
        LOG.info("Try to fetch from google bucket...")
        url = ("https://storage.googleapis.com/gnomad-public/legacy/exacv1_downloads/release0.3.1"
               "/manuscript_data/forweb_cleaned_exac_r03_march16_z_data_pLI.txt.gz")

    exac_lines = fetch_resource(url)

    return exac_lines
def fetch_exac_constraint():
    """Fetch the file with exac constraint scores
    
    Returns:
        exac_lines(iterable(str))
    """
    file_name = 'fordist_cleaned_exac_r03_march16_z_pli_rec_null_data.txt' 
    url = ('ftp://ftp.broadinstitute.org/pub/ExAC_release/release0.3/functional_gene_constraint'
           '/{0}').format(file_name)
    
    LOG.info("Fetching ExAC genes")
    
    try:
        exac_lines = fetch_resource(url)
    except URLError as err:
        LOG.info("Failed to fetch exac constraint scores file from ftp server")
        LOG.info("Try to fetch from google bucket...")
        url = ("https://storage.googleapis.com/gnomad-public/legacy/exacv1_downloads/release0.3.1"
               "/manuscript_data/forweb_cleaned_exac_r03_march16_z_data_pLI.txt.gz")

    exac_lines = fetch_resource(url)

    return exac_lines
def fetch_exac_constraint ( ) : file_name = 'fordist_cleaned_exac_r03_march16_z_pli_rec_null_data.txt' url = ( 'ftp://ftp.broadinstitute.org/pub/ExAC_release/release0.3/functional_gene_constraint' '/{0}' ) . format ( file_name ) LOG . info ( "Fetching ExAC genes" ) try : exac_lines = fetch_resource ( url ) except URLError as err : LOG . info ( "Failed to fetch exac constraint scores file from ftp server" ) LOG . info ( "Try to fetch from google bucket..." ) url = ( "https://storage.googleapis.com/gnomad-public/legacy/exacv1_downloads/release0.3.1" "/manuscript_data/forweb_cleaned_exac_r03_march16_z_data_pLI.txt.gz" ) exac_lines = fetch_resource ( url ) return exac_lines
Fetch the file with exac constraint scores
    
    Returns:
        exac_lines(iterable(str))
Fetch the file with exac constraint scores Returns : exac_lines ( iterable ( str ))