utils/genome_search_utils.py
def calculate_seqdb_size(project_dir, mb=True):
    """
    Loops over all genome directories in the project dir, as organized by
    genome_downloader.py and calculates the size of the new seqdb

    project_dir (path): The path to the project_dir (result of genome_downloader.py)
    mb (boolean): If True convert nucleotides to megabases. Default True

    return: The size of the seqdb (nt)
    """

    seqdb_size = 0

    # list domain directories
    domain_dirs = [x for x in os.listdir(project_dir)
                   if os.path.isdir(os.path.join(project_dir, x))]

    # loop over domain directory
    for domain_dir in domain_dirs:
        domain_dir_loc = os.path.join(project_dir, domain_dir)
        genome_dirs = os.listdir(domain_dir_loc)

        # loop over genome directory
        for genome in genome_dirs:
            genome_dir_loc = os.path.join(domain_dir_loc, genome)
            # get genome seq sizes
            gen_size_dict = get_genome_file_sizes(genome_dir_loc, output_file=False)

            # sum genome seq sizes and seqdb_size
            for acc in gen_size_dict.keys():
                seqdb_size += gen_size_dict[acc]

    # convert seqdb_size to Megabases and return
    if mb is True:
        return float(seqdb_size)/float(MB)

    return seqdb_size

    Loops over all genome directories in the project dir, as organized by
    genome_downloader.py and calculates the size of the new seqdb

    project_dir (path): The path to the project_dir (result of genome_downloader.py)
    mb (boolean): If True convert nucleotides to megabases. Default True

    return: The size of the seqdb (nt)
    
Loops over all genome directories in the project dir, as organized by
genome_downloader.py and calculates the size of the new seqdb

project_dir (path): The path to the project_dir (result of genome_downloader.py)
mb (boolean): If True convert nucleotides to megabases. Default True

The size of the seqdb (nt)
Loops over all genome directories in the project dir as organized by genome_downloader . py and calculates the size of the new seqdb project_dir ( path ) : The path to the project_dir ( result of genome_downloader . py ) mb ( boolean ) : If True convert nucleotides to megabases . Default True The size of the seqdb ( nt )
def calculate_seqdb_size(project_dir, mb=True):
    seqdb_size = 0
    domain_dirs = [x for x in os.listdir(project_dir)
                   if os.path.isdir(os.path.join(project_dir, x))]
    for domain_dir in domain_dirs:
        domain_dir_loc = os.path.join(project_dir, domain_dir)
        genome_dirs = os.listdir(domain_dir_loc)
        for genome in genome_dirs:
            genome_dir_loc = os.path.join(domain_dir_loc, genome)
            gen_size_dict = get_genome_file_sizes(genome_dir_loc, output_file=False)
            for acc in gen_size_dict.keys():
                seqdb_size += gen_size_dict[acc]
    if mb is True:
        return float(seqdb_size)/float(MB)
    return seqdb_size
def calculate_seqdb_size ( project_dir , mb = True ) : seqdb_size = 0 domain_dirs = [ x for x in os . listdir ( project_dir ) if os . path . isdir ( os . path . join ( project_dir , x ) ) ] for domain_dir in domain_dirs : domain_dir_loc = os . path . join ( project_dir , domain_dir ) genome_dirs = os . listdir ( domain_dir_loc ) for genome in genome_dirs : genome_dir_loc = os . path . join ( domain_dir_loc , genome ) gen_size_dict = get_genome_file_sizes ( genome_dir_loc , output_file = False ) for acc in gen_size_dict . keys ( ) : seqdb_size += gen_size_dict [ acc ] if mb is True : return float ( seqdb_size ) / float ( MB ) return seqdb_size
Loops over all genome directories in the project dir, as organized by
genome_downloader.py and calculates the size of the new seqdb
Loops over all genome directories in the project dir as organized by genome_downloader . py and calculates the size of the new seqdb
"""
    Loops over all genome directories in the project dir, as organized by
    genome_downloader.py and calculates the size of the new seqdb

    project_dir (path): The path to the project_dir (result of genome_downloader.py)
    mb (boolean): If True convert nucleotides to megabases. Default True

    return: The size of the seqdb (nt)
    """ # list domain directories # loop over domain directory # loop over genome directory # get genome seq sizes # sum genome seq sizes and seqdb_size # convert seqdb_size to Megabases and return
project_dir
mb