# Path: kvarq/util.py
# def get_root_path(*parts):
#     if is_exe():
#         return os.path.join(sys.prefix, *parts)
#     elif is_app():
#         return os.path.join(sys.prefix, os.path.pardir, os.path.pardir,
#                 os.path.pardir, *parts)
#     else:
#         root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
#         return os.path.join(root, *parts)
# 
# Path: kvarq/log.py
# class ColoredFormatter(logging.Formatter):
#     def format(self, record):
# def color_wrap(handler, emit_bak):
#     def emit(record):
# def set_debug():
# def set_info():
# def set_warning():
# def appendlog(fname):
# def tic(name):
# def toc(name):
# def tictoc(name):
#     def decorator(f):
#         def wrapper(*args, **kwargs):
# def format_traceback(exc_info):


import kvarq
import os.path, glob
import sys
import re
from kvarq.util import get_root_path
from kvarq.log import lo, format_traceback
from distutils.version import StrictVersion
            FASTA file if none specified
        :param description: text description; will also be read from
            FASTA file if none specified
        '''
        self.path = path
        self.f = file(path,'r')

        if self.f.read(1) == '>':
            self.fasta = True
            self.f.seek(0)
            defline = self.f.readline()
            idx = defline.find(' ')
            if identifier is None:
                if idx == -1:
                    identifier = defline[1:]
                else:
                    identifier = defline[1:idx]
            if description is None:
                if idx != -1 and idx < len(defline):
                    description = defline[idx + 1:]

            # read whole sequence into memory
            self.bases = ''
            self.bases = ''.join([line.rstrip('\n\r')
                    for line in self.f.readlines()])
            if '>' in self.bases:
                lo.info('%s contains several genomes; only first read' % path)
                self.bases = self.bases[:self.bases.index('>')]
            self.size = len(self.bases)
            self.f.close()

# Path: kvarq/util.py
# def get_root_path(*parts):
#     if is_exe():
#         return os.path.join(sys.prefix, *parts)
#     elif is_app():
#         return os.path.join(sys.prefix, os.path.pardir, os.path.pardir,
#                 os.path.pardir, *parts)
#     else:
#         root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
#         return os.path.join(root, *parts)
# 
# Path: kvarq/log.py
# class ColoredFormatter(logging.Formatter):
#     def format(self, record):
# def color_wrap(handler, emit_bak):
#     def emit(record):
# def set_debug():
# def set_info():
# def set_warning():
# def appendlog(fname):
# def tic(name):
# def toc(name):
# def tictoc(name):
#     def decorator(f):
#         def wrapper(*args, **kwargs):
# def format_traceback(exc_info):


# Path: kvarq/genes.py
import kvarq
import os.path, glob
import sys
import re
from kvarq.util import get_root_path
from kvarq.log import lo, format_traceback
from distutils.version import StrictVersion

            FASTA file if none specified
        :param description: text description; will also be read from
            FASTA file if none specified
        '''
        self.path = path
        self.f = file(path,'r')

        if self.f.read(1) == '>':
            self.fasta = True
            self.f.seek(0)
            defline = self.f.readline()
            idx = defline.find(' ')
            if identifier is None:
                if idx == -1:
                    identifier = defline[1:]
                else:
                    identifier = defline[1:idx]
            if description is None:
                if idx != -1 and idx < len(defline):
                    description = defline[idx + 1:]

            # read whole sequence into memory
            self.bases = ''
            self.bases = ''.join([line.rstrip('\n\r')
                    for line in self.f.readlines()])
            if '>' in self.bases:
                lo.info('%s contains several genomes; only first read' % path)
                self.bases = self.bases[:self.bases.index('>')]
            self.size = len(self.bases)
            self.f.close()

            lo.debug('read %d bytes FASTA sequence "%s" into memory' % (