# Path: constants.py
# ALPHABET = ['A', 'C', 'G', 'T']
# 
# EXTENDED_ALPHABET = ['A', 'C', 'G', 'T', 'N', 'M', 'K']
# 
# TFFM_KIND = enum(FIRST_ORDER="1st-order", DETAILED="detailed",
#                  ZERO_ORDER="0-order")
# 
# LOGO_TYPE = enum(SUMMARY="summary", DENSE="dense")


import sys
import os
import math
import re
import ghmm
import drawing
import exceptions_errors
import utils
import hit_module
from Bio.Alphabet import IUPAC
from Bio import SeqIO
from Bio import motifs
from constants import ALPHABET, EXTENDED_ALPHABET, TFFM_KIND, LOGO_TYPE
        functions :func:`tffm_from_xml` or :func:`tffm_from_meme`.

    """

    def __init__(self, emission_domain, distribution, cmodel, kind,
                 name="TFFM"):
        """
        Construct an instance of the TFFM class.

        :arg emission_domain: The emission domain of the
            underlying :class:`ghmm.HMM`.
        :type emission_domain: ghmm.EmissionDomain
        :arg distribution: The distribution over the emission domain.
        :type distribution: :class:`ghmm.Distribution`
        :arg cmodel: The cmodel (HMM itself implemented in C) of the underlying
            :class:`ghmm.HMM`.
        :arg kind: The TFFM can be either a 0-order, a 1st-order, or a detailed
            TFFM, use `TFFM_KIND.ZERO_ORDER, or `TFFM_KIND.FIRST_ORDER`, or
            `TFFM_KIND.DETAILED` respectively.
        :type kind: Enum
        :arg name: Give the name of the TFFM. 'TFFM' is given by default.
        :type name: str
        :raises: :class:`exceptions.TFFMKindError` when the given kind is
            neither '1st-order' nor 'detailed'.

        """

        # Construct the underlying ghmm.EmissionHMM
        super(ghmm.DiscreteEmissionHMM, self).__init__(emission_domain,
                                                       distribution, cmodel)

# Path: constants.py
# ALPHABET = ['A', 'C', 'G', 'T']
# 
# EXTENDED_ALPHABET = ['A', 'C', 'G', 'T', 'N', 'M', 'K']
# 
# TFFM_KIND = enum(FIRST_ORDER="1st-order", DETAILED="detailed",
#                  ZERO_ORDER="0-order")
# 
# LOGO_TYPE = enum(SUMMARY="summary", DENSE="dense")


# Path: tffm_module.py
import sys
import os
import math
import re
import ghmm
import drawing
import exceptions_errors
import utils
import hit_module
from Bio.Alphabet import IUPAC
from Bio import SeqIO
from Bio import motifs
from constants import ALPHABET, EXTENDED_ALPHABET, TFFM_KIND, LOGO_TYPE

        functions :func:`tffm_from_xml` or :func:`tffm_from_meme`.

    """

    def __init__(self, emission_domain, distribution, cmodel, kind,
                 name="TFFM"):
        """
        Construct an instance of the TFFM class.

        :arg emission_domain: The emission domain of the
            underlying :class:`ghmm.HMM`.
        :type emission_domain: ghmm.EmissionDomain
        :arg distribution: The distribution over the emission domain.
        :type distribution: :class:`ghmm.Distribution`
        :arg cmodel: The cmodel (HMM itself implemented in C) of the underlying
            :class:`ghmm.HMM`.
        :arg kind: The TFFM can be either a 0-order, a 1st-order, or a detailed
            TFFM, use `TFFM_KIND.ZERO_ORDER, or `TFFM_KIND.FIRST_ORDER`, or
            `TFFM_KIND.DETAILED` respectively.
        :type kind: Enum
        :arg name: Give the name of the TFFM. 'TFFM' is given by default.
        :type name: str
        :raises: :class:`exceptions.TFFMKindError` when the given kind is
            neither '1st-order' nor 'detailed'.

        """

        # Construct the underlying ghmm.EmissionHMM
        super(ghmm.DiscreteEmissionHMM, self).__init__(emission_domain,
                                                       distribution, cmodel)

        if(kind != TFFM_KIND.FIRST_ORDER and kind != TFFM_KIND.DETAILED and