# Path: taxtastic/refpkg.py
# FORMAT_VERSION = '1.1'
# class DerivedFileNotUpdatedWarning(UserWarning):
# class NoAncestor(Exception):
# class Refpkg(object):
# def is_string(val):
# def md5file(fobj):
# def scratch_file(unlink=True, **kwargs):
# def manifest_template():
# def transaction(f, self, *args, **kwargs):
#     def __init__(self, path, create=None):
#     def _install_zipfile_handlers(self):
#         def zipopen(name, *mode):
#         def file_path(name):
#     def file_path(self, name):
#     def open(self, name, *mode):
#     def open_manifest(self, *mode):
#     def open_resource(self, resource, *mode):
#     def resource_name(self, resource):
#     def resource_md5(self, resource):
#     def calculate_resource_md5(self, resource):
#     def resource_path(self, resource):
#     def _set_defaults(self):
#     def _sync_to_disk(self):
#     def _sync_from_disk(self):
#     def _add_file(self, key, path):
#     def _delete_file(self, path):
#     def metadata(self, key):
#     def file_keys(self):
#     def metadata_keys(self):
#     def _log(self, msg):
#     def log(self):
#     def is_invalid(self):
#     def _check_refpkg(self):
#     def update_metadata(self, key, value):
#     def update_file(self, key, new_path):
#     def reroot(self, rppr=None, pretend=False):
#     def update_phylo_model(self, stats_type, stats_file, frequency_type=None):
#     def rollback(self):
#     def rollforward(self):
#     def strip(self):
#     def start_transaction(self):
#     def commit_transaction(self, log=None):
#     def is_ill_formed(self):
#     def load_db(self):
#     def most_recent_common_ancestor(self, *ts):
#     def _large_mrca(self, ts):
#     def _small_mrca(self, ts):
#     def file_abspath(self, resource):
#     def file_name(self, resource):
#     def file_md5(self, resource):


import logging
import csv
import sys
import argparse
from collections import Counter
from taxtastic import refpkg
        metavar='refpkg',
        help='the reference package to operate on', nargs='?')
    parser.add_argument(
        '-t', '--taxonomy',
        metavar='csv file',
        help=('Path to taxtable '
              '(ignored if refpkg is provided, required otherwise)'))
    parser.add_argument(
        '-i', '--seq_info',
        metavar='csv file',
        help=('Path to seq_info '
              '(ignored if refpkg is provided, required otherwise)'))
    parser.add_argument(
        '-r', '--rank',
        default='species',
        metavar='RANK',
        help='show composition at RANK [%(default)s]')
    parser.add_argument(
        '-o', '--out',
        default=sys.stdout,
        type=argparse.FileType('w'),
        help=('rank at which to show composition. Use '
              '--rank=tax_id to show original '
              'classifications [stdout]'))


def action(args):

    if args.refpkg:
        log.info('loading reference package')

# Path: taxtastic/refpkg.py
# FORMAT_VERSION = '1.1'
# class DerivedFileNotUpdatedWarning(UserWarning):
# class NoAncestor(Exception):
# class Refpkg(object):
# def is_string(val):
# def md5file(fobj):
# def scratch_file(unlink=True, **kwargs):
# def manifest_template():
# def transaction(f, self, *args, **kwargs):
#     def __init__(self, path, create=None):
#     def _install_zipfile_handlers(self):
#         def zipopen(name, *mode):
#         def file_path(name):
#     def file_path(self, name):
#     def open(self, name, *mode):
#     def open_manifest(self, *mode):
#     def open_resource(self, resource, *mode):
#     def resource_name(self, resource):
#     def resource_md5(self, resource):
#     def calculate_resource_md5(self, resource):
#     def resource_path(self, resource):
#     def _set_defaults(self):
#     def _sync_to_disk(self):
#     def _sync_from_disk(self):
#     def _add_file(self, key, path):
#     def _delete_file(self, path):
#     def metadata(self, key):
#     def file_keys(self):
#     def metadata_keys(self):
#     def _log(self, msg):
#     def log(self):
#     def is_invalid(self):
#     def _check_refpkg(self):
#     def update_metadata(self, key, value):
#     def update_file(self, key, new_path):
#     def reroot(self, rppr=None, pretend=False):
#     def update_phylo_model(self, stats_type, stats_file, frequency_type=None):
#     def rollback(self):
#     def rollforward(self):
#     def strip(self):
#     def start_transaction(self):
#     def commit_transaction(self, log=None):
#     def is_ill_formed(self):
#     def load_db(self):
#     def most_recent_common_ancestor(self, *ts):
#     def _large_mrca(self, ts):
#     def _small_mrca(self, ts):
#     def file_abspath(self, resource):
#     def file_name(self, resource):
#     def file_md5(self, resource):


# Path: taxtastic/subcommands/composition.py
import logging
import csv
import sys
import argparse
from collections import Counter
from taxtastic import refpkg

        metavar='refpkg',
        help='the reference package to operate on', nargs='?')
    parser.add_argument(
        '-t', '--taxonomy',
        metavar='csv file',
        help=('Path to taxtable '
              '(ignored if refpkg is provided, required otherwise)'))
    parser.add_argument(
        '-i', '--seq_info',
        metavar='csv file',
        help=('Path to seq_info '
              '(ignored if refpkg is provided, required otherwise)'))
    parser.add_argument(
        '-r', '--rank',
        default='species',
        metavar='RANK',
        help='show composition at RANK [%(default)s]')
    parser.add_argument(
        '-o', '--out',
        default=sys.stdout,
        type=argparse.FileType('w'),
        help=('rank at which to show composition. Use '
              '--rank=tax_id to show original '
              'classifications [stdout]'))


def action(args):

    if args.refpkg:
        log.info('loading reference package')

        pkg = refpkg.Refpkg(args.refpkg, create=False)