scripts/export/genomes/genome_fetch.py
def fetch_genome(gen, dest_dir):
    """
    Downloads and parses xml file of the given genome accession (gen), and
    downloads all chromosome files in fasta format in destination directory
    (dest_dir). The xml file is deleted after completion.

    gen: ENA assembly accession (GCA*)
    dest_dir: Destination of the output directory
    """

    gen_dir = os.path.join(dest_dir, gen.partition('.')[0])

    try:
        os.mkdir(gen_dir)
    except:
        pass

    fetch_ena_file(gen, "xml", gen_dir)

    gen_xml = os.path.join(gen_dir, gen + ".xml")
    chroms = extract_assembly_accs(gen_xml)

    for chrom in chroms:
        fetch_ena_file(chrom, "fasta", gen_dir)

    os.remove(gen_xml)

    Downloads and parses xml file of the given genome accession (gen), and
    downloads all chromosome files in fasta format in destination directory
    (dest_dir). The xml file is deleted after completion.

    gen: ENA assembly accession (GCA*)
    dest_dir: Destination of the output directory
    
Downloads and parses xml file of the given genome accession (gen), and
downloads all chromosome files in fasta format in destination directory
(dest_dir). The xml file is deleted after completion.

ENA assembly accession (GCA*)
dest_dir: Destination of the output directory
Downloads and parses xml file of the given genome accession ( gen ) and downloads all chromosome files in fasta format in destination directory ( dest_dir ) . The xml file is deleted after completion . ENA assembly accession ( GCA * ) dest_dir : Destination of the output directory
def fetch_genome(gen, dest_dir):
    gen_dir = os.path.join(dest_dir, gen.partition('.')[0])
    try:
        os.mkdir(gen_dir)
    except:
        pass
    fetch_ena_file(gen, "xml", gen_dir)
    gen_xml = os.path.join(gen_dir, gen + ".xml")
    chroms = extract_assembly_accs(gen_xml)
    for chrom in chroms:
        fetch_ena_file(chrom, "fasta", gen_dir)
    os.remove(gen_xml)
def fetch_genome ( gen , dest_dir ) : gen_dir = os . path . join ( dest_dir , gen . partition ( '.' ) [ 0 ] ) try : os . mkdir ( gen_dir ) except : pass fetch_ena_file ( gen , "xml" , gen_dir ) gen_xml = os . path . join ( gen_dir , gen + ".xml" ) chroms = extract_assembly_accs ( gen_xml ) for chrom in chroms : fetch_ena_file ( chrom , "fasta" , gen_dir ) os . remove ( gen_xml )
Downloads and parses xml file of the given genome accession (gen), and
downloads all chromosome files in fasta format in destination directory
(dest_dir).
Downloads and parses xml file of the given genome accession ( gen ) and downloads all chromosome files in fasta format in destination directory ( dest_dir ) .
"""
    Downloads and parses xml file of the given genome accession (gen), and
    downloads all chromosome files in fasta format in destination directory
    (dest_dir). The xml file is deleted after completion.

    gen: ENA assembly accession (GCA*)
    dest_dir: Destination of the output directory
    """
gen
dest_dir