# 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
        model excluding the background.

        """

        if self.kind == TFFM_KIND.FIRST_ORDER:
            return self.N - 2
        elif self.kind == TFFM_KIND.DETAILED:
            return self.N / 4 - 1
        else:  # 0-order HMM here
            return self.N - 1

    def background_emission_proba(self):
        """
        Return the emission probabilities of the nucleotides in the background
        state.

        :returns: A dictionnary with characters 'A', 'C', 'G', and 'T' as keys
            and the corresponding probabilities as values.
        :rtype: dict

        """

        emissions = {'A': 0., 'C': 0., 'G': 0., 'T': 0.}
        if self.kind == TFFM_KIND.FIRST_ORDER:
            emissions = background_emission_proba_1storder(self)
        elif self.kind == TFFM_KIND.DETAILED:
            emissions = background_emission_proba_detailed(self)
        else:  # 0-order HMM here
            emissions = background_emission_proba_detailed(self)
            for i in xrange(4):

# 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

        model excluding the background.

        """

        if self.kind == TFFM_KIND.FIRST_ORDER:
            return self.N - 2
        elif self.kind == TFFM_KIND.DETAILED:
            return self.N / 4 - 1
        else:  # 0-order HMM here
            return self.N - 1

    def background_emission_proba(self):
        """
        Return the emission probabilities of the nucleotides in the background
        state.

        :returns: A dictionnary with characters 'A', 'C', 'G', and 'T' as keys
            and the corresponding probabilities as values.
        :rtype: dict

        """

        emissions = {'A': 0., 'C': 0., 'G': 0., 'T': 0.}
        if self.kind == TFFM_KIND.FIRST_ORDER:
            emissions = background_emission_proba_1storder(self)
        elif self.kind == TFFM_KIND.DETAILED:
            emissions = background_emission_proba_detailed(self)
        else:  # 0-order HMM here
            emissions = background_emission_proba_detailed(self)
            for i in xrange(4):

                emissions[ALPHABET[i]] = self.getEmission(0)[i]