# Path: lib/core_preprocessor.py
# def preprocess(args):
#     """Build the databases required by atram."""
#     log = Logger(args['log_file'], args['log_level'])
#     log.header()
# 
#     with util.make_temp_dir(
#             where=args['temp_dir'],
#             prefix='atram_preprocessor_',
#             keep=args['keep_temp_dir']) as temp_dir:
#         util.update_temp_dir(temp_dir, args)
# 
#         with db.connect(args['blast_db'], clean=True) as cxn:
#             db_preprocessor.create_metadata_table(cxn, args)
# 
#             db_preprocessor.create_sequences_table(cxn)
#             load_seqs(args, cxn, log)
# 
#             log.info('Creating an index for the sequence table')
#             db_preprocessor.create_sequences_index(cxn)
# 
#             if not args['shuffle']:
#                 shard_list = assign_seqs_to_shards(
#                     cxn, log, args['shard_count'])
# 
#         if args['shuffle']:
#             create_all_shuffled_shards(args, cxn, log, args['shard_count'])
#         else:
#             create_all_shards(args, log, shard_list)


import argparse
import os
import textwrap
import lib.blast as blast
import lib.db as db
import lib.util as util
from datetime import date
from glob import glob
from itertools import chain
from os.path import join
from lib.core_preprocessor import preprocess
#!/usr/bin/env python3
"""
Start the atram preprocessor.

This wrapper module parses the input arguments and passes them to the module
that does the actual preprocessing (core_preprocessor.py).
"""




def parse_command_line():
    """Process command-line arguments."""
    description = """

# Path: lib/core_preprocessor.py
# def preprocess(args):
#     """Build the databases required by atram."""
#     log = Logger(args['log_file'], args['log_level'])
#     log.header()
# 
#     with util.make_temp_dir(
#             where=args['temp_dir'],
#             prefix='atram_preprocessor_',
#             keep=args['keep_temp_dir']) as temp_dir:
#         util.update_temp_dir(temp_dir, args)
# 
#         with db.connect(args['blast_db'], clean=True) as cxn:
#             db_preprocessor.create_metadata_table(cxn, args)
# 
#             db_preprocessor.create_sequences_table(cxn)
#             load_seqs(args, cxn, log)
# 
#             log.info('Creating an index for the sequence table')
#             db_preprocessor.create_sequences_index(cxn)
# 
#             if not args['shuffle']:
#                 shard_list = assign_seqs_to_shards(
#                     cxn, log, args['shard_count'])
# 
#         if args['shuffle']:
#             create_all_shuffled_shards(args, cxn, log, args['shard_count'])
#         else:
#             create_all_shards(args, log, shard_list)


# Path: atram_preprocessor.py
import argparse
import os
import textwrap
import lib.blast as blast
import lib.db as db
import lib.util as util
from datetime import date
from glob import glob
from itertools import chain
from os.path import join
from lib.core_preprocessor import preprocess

#!/usr/bin/env python3
"""
Start the atram preprocessor.

This wrapper module parses the input arguments and passes them to the module
that does the actual preprocessing (core_preprocessor.py).
"""




def parse_command_line():
    """Process command-line arguments."""
    description = """

        This script prepares data for use by the atram.py