scripts/release/genome_browser_hub_generator.py
def generate_genome_text_file_from_file(names_list, release_version, dest_dir):
    """
    Generates the genome.txt file for the genome_browser_hup given a list
    of assembly-scientific name mappings

    names_list: A tab delimited file containing mappings of the
    assembly name and the genome scientific name e.g hg38\thomo_sapiens
    version: The version of the release
    dest_dir: The destination directory where the genome.txt
    file will be generated

    return:
    """

    trackdb_url = "ftp://ftp.ebi.ac.uk/pub/databases/Rfam/%s/genome_browser_hub/%s/trackDb.txt"

    fp_in = open(names_list, 'r')

    name_mappings = {}

    # parse input file and store information in a dictionary
    for line in fp_in:
        line = line.strip().split('\t')

        if line[0] not in name_mappings:
            name_mappings[line[0]] = line[1]

    fp_in.close()

    fp_out = open(os.path.join(dest_dir, "genomes.txt"), 'w')

    for assembly_acc in name_mappings.keys():
        fp_out.write("genome %s\n" % assembly_acc)
        fp_out.write("trackDb " + trackdb_url + "\n\n" % (str(release_version),
                                             name_mappings[assembly_acc]))

    fp_out.close()

    Generates the genome.txt file for the genome_browser_hup given a list
    of assembly-scientific name mappings

    names_list: A tab delimited file containing mappings of the
    assembly name and the genome scientific name e.g hg38\thomo_sapiens
    version: The version of the release
    dest_dir: The destination directory where the genome.txt
    file will be generated

    return:
    
Generates the genome.txt file for the genome_browser_hup given a list
of assembly-scientific name mappings

A tab delimited file containing mappings of the
assembly name and the genome scientific name e.g hg38\thomo_sapiens
version: The version of the release
dest_dir: The destination directory where the genome.txt
file will be generated


Generates the genome . txt file for the genome_browser_hup given a list of assembly - scientific name mappings A tab delimited file containing mappings of the assembly name and the genome scientific name e . g hg38 \ thomo_sapiens version : The version of the release dest_dir : The destination directory where the genome . txt file will be generated
def generate_genome_text_file_from_file(names_list, release_version, dest_dir):
    trackdb_url = "ftp://ftp.ebi.ac.uk/pub/databases/Rfam/%s/genome_browser_hub/%s/trackDb.txt"
    fp_in = open(names_list, 'r')
    name_mappings = {}
    for line in fp_in:
        line = line.strip().split('\t')
        if line[0] not in name_mappings:
            name_mappings[line[0]] = line[1]
    fp_in.close()
    fp_out = open(os.path.join(dest_dir, "genomes.txt"), 'w')
    for assembly_acc in name_mappings.keys():
        fp_out.write("genome %s\n" % assembly_acc)
        fp_out.write("trackDb " + trackdb_url + "\n\n" % (str(release_version),
                                             name_mappings[assembly_acc]))
    fp_out.close()
def generate_genome_text_file_from_file ( names_list , release_version , dest_dir ) : trackdb_url = "ftp://ftp.ebi.ac.uk/pub/databases/Rfam/%s/genome_browser_hub/%s/trackDb.txt" fp_in = open ( names_list , 'r' ) name_mappings = { } for line in fp_in : line = line . strip ( ) . split ( '\t' ) if line [ 0 ] not in name_mappings : name_mappings [ line [ 0 ] ] = line [ 1 ] fp_in . close ( ) fp_out = open ( os . path . join ( dest_dir , "genomes.txt" ) , 'w' ) for assembly_acc in name_mappings . keys ( ) : fp_out . write ( "genome %s\n" % assembly_acc ) fp_out . write ( "trackDb " + trackdb_url + "\n\n" % ( str ( release_version ) , name_mappings [ assembly_acc ] ) ) fp_out . close ( )
Generates the genome.txt file for the genome_browser_hup given a list
of assembly-scientific name mappings
Generates the genome . txt file for the genome_browser_hup given a list of assembly - scientific name mappings
"""
    Generates the genome.txt file for the genome_browser_hup given a list
    of assembly-scientific name mappings

    names_list: A tab delimited file containing mappings of the
    assembly name and the genome scientific name e.g hg38\thomo_sapiens
    version: The version of the release
    dest_dir: The destination directory where the genome.txt
    file will be generated

    return:
    """ # parse input file and store information in a dictionary
names_list
release_version
dest_dir