scripts/export/genomes/fetch_gen_metadata.py
def region_loader(reg_ftp_link):
    """
    Parses an assembly's region file and builds a dictionary of accessions and
    start-end coordinates which are stored in a tuple format

    reg_ftp_link: The ftp url of the corresponding region file
    """

    region_dict = {}

    http_link = reg_ftp_link.replace("ftp://", "http://")
    response = requests.get(http_link).content

    regions = response.strip().split('\n')

    # remove header
    regions.pop(0)

    for region in regions:
        region = region.strip().split('\t')
        coords = region[5].split('-')
        region_dict[region[1]] = (int(coords[0]), int(coords[1]))

    return region_dict

    Parses an assembly's region file and builds a dictionary of accessions and
    start-end coordinates which are stored in a tuple format

    reg_ftp_link: The ftp url of the corresponding region file
    
Parses an assembly's region file and builds a dictionary of accessions and
start-end coordinates which are stored in a tuple format

The ftp url of the corresponding region file
Parses an assembly ' s region file and builds a dictionary of accessions and start - end coordinates which are stored in a tuple format The ftp url of the corresponding region file
def region_loader(reg_ftp_link):
    region_dict = {}
    http_link = reg_ftp_link.replace("ftp://", "http://")
    response = requests.get(http_link).content
    regions = response.strip().split('\n')
    regions.pop(0)
    for region in regions:
        region = region.strip().split('\t')
        coords = region[5].split('-')
        region_dict[region[1]] = (int(coords[0]), int(coords[1]))
    return region_dict
def region_loader ( reg_ftp_link ) : region_dict = { } http_link = reg_ftp_link . replace ( "ftp://" , "http://" ) response = requests . get ( http_link ) . content regions = response . strip ( ) . split ( '\n' ) regions . pop ( 0 ) for region in regions : region = region . strip ( ) . split ( '\t' ) coords = region [ 5 ] . split ( '-' ) region_dict [ region [ 1 ] ] = ( int ( coords [ 0 ] ) , int ( coords [ 1 ] ) ) return region_dict
Parses an assembly's region file and builds a dictionary of accessions and
start-end coordinates which are stored in a tuple format
Parses an assembly ' s region file and builds a dictionary of accessions and start - end coordinates which are stored in a tuple format
"""
    Parses an assembly's region file and builds a dictionary of accessions and
    start-end coordinates which are stored in a tuple format

    reg_ftp_link: The ftp url of the corresponding region file
    """ # remove header
reg_ftp_link