scripts/release/genome_browser_hub_generator.py
def genome_browser_hub_id_list_parser(genome_id_list):
    """
    Parses the input file of genome browser hub and returns
    a dictionary with the ids to be used to generate all
    related sub directories and files

    genome_id_list: A tab delimited file containing the genome upids, assembly names and
    scientific names for each genome

    return: A dictionary in the form of {upid: {"assembly_name": "assembly name",
                                                "species": "scientific name"}
    """

    accession_mapings = {}

    fp_in = open(genome_id_list, 'r')

    if genome_id_list.endswith(".json"):
        accession_mapings = json.load(fp_in)

    else:
        # parse file and generate the dictionary
        for line in fp_in:
            line = line.strip().split('\t')

            if line[0] not in accession_mapings:
                accession_mapings[line[0]] = {}
                accession_mapings[line[0]]["assembly_name"] = line[1]
                accession_mapings[line[0]]["species_name"] = line[2]

    # close input file and return dictionary
    fp_in.close()
    return accession_mapings

    Parses the input file of genome browser hub and returns
    a dictionary with the ids to be used to generate all
    related sub directories and files

    genome_id_list: A tab delimited file containing the genome upids, assembly names and
    scientific names for each genome

    return: A dictionary in the form of {upid: {"assembly_name": "assembly name",
                                                "species": "scientific name"}
    
Parses the input file of genome browser hub and returns
a dictionary with the ids to be used to generate all
related sub directories and files

A tab delimited file containing the genome upids, assembly names and
scientific names for each genome


Parses the input file of genome browser hub and returns a dictionary with the ids to be used to generate all related sub directories and files A tab delimited file containing the genome upids assembly names and scientific names for each genome
def genome_browser_hub_id_list_parser(genome_id_list):
    accession_mapings = {}
    fp_in = open(genome_id_list, 'r')
    if genome_id_list.endswith(".json"):
        accession_mapings = json.load(fp_in)
    else:
        for line in fp_in:
            line = line.strip().split('\t')
            if line[0] not in accession_mapings:
                accession_mapings[line[0]] = {}
                accession_mapings[line[0]]["assembly_name"] = line[1]
                accession_mapings[line[0]]["species_name"] = line[2]
    fp_in.close()
    return accession_mapings
def genome_browser_hub_id_list_parser ( genome_id_list ) : accession_mapings = { } fp_in = open ( genome_id_list , 'r' ) if genome_id_list . endswith ( ".json" ) : accession_mapings = json . load ( fp_in ) else : for line in fp_in : line = line . strip ( ) . split ( '\t' ) if line [ 0 ] not in accession_mapings : accession_mapings [ line [ 0 ] ] = { } accession_mapings [ line [ 0 ] ] [ "assembly_name" ] = line [ 1 ] accession_mapings [ line [ 0 ] ] [ "species_name" ] = line [ 2 ] fp_in . close ( ) return accession_mapings
Parses the input file of genome browser hub and returns
a dictionary with the ids to be used to generate all
related sub directories and files
Parses the input file of genome browser hub and returns a dictionary with the ids to be used to generate all related sub directories and files
"""
    Parses the input file of genome browser hub and returns
    a dictionary with the ids to be used to generate all
    related sub directories and files

    genome_id_list: A tab delimited file containing the genome upids, assembly names and
    scientific names for each genome

    return: A dictionary in the form of {upid: {"assembly_name": "assembly name",
                                                "species": "scientific name"}
    """ # parse file and generate the dictionary # close input file and return dictionary
genome_id_list