# Path: phydmslib/constants.py
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}
# 
# NT_TO_INDEX = {nt: i for (i, nt) in INDEX_TO_NT.items()}


import collections
import os
import tempfile
import string
import math
import shutil
import natsort
import numpy
import matplotlib
import pylab
import PyPDF2
import weblogolib  # weblogo library
import weblogolib.colorscheme  # weblogo library
import corebio.matrix  # weblogo library
import corebio.utils  # weblogo library
    import doctest
from phydmslib.constants import AA_TO_INDEX, NT_TO_INDEX
        J. Kyte & R. F. Doolittle:
        "A simple method for displaying the hydropathic character of a
        protein." J Mol Biol, 157, 105-132

    More positive values indicate higher hydrophobicity,
    while more negative values indicate lower hydrophobicity.

    The returned variable is the 3-tuple *(cmap, mapping_d, mapper)*:

        * *cmap* is a ``pylab`` *LinearSegmentedColorMap* object.

        * *mapping_d* is a dictionary keyed by the one-letter amino-acid
          codes. The values are the colors in CSS2 format (e.g. #FF0000
          for red) for that amino acid. The value for a stop codon
          (denoted by a ``*`` character) is black (#000000).

        * *mapper* is the actual *pylab.cm.ScalarMappable* object.

    The optional argument *maptype* should specify a valid ``pylab`` color map.

    The optional calling argument *reverse* specifies that we set up the color
    map so that the most hydrophobic residue comes first (in the Kyte-Doolittle
    scale the most hydrophobic comes last as it has the largest value).
    This option is *True* by default as it seems more intuitive to have
    charged residues red and hydrophobic ones blue.
    """
    d = {'A': 1.8, 'C': 2.5, 'D': -3.5, 'E': -3.5, 'F': 2.8, 'G': -0.4,
         'H': -3.2, 'I': 4.5, 'K': -3.9, 'L': 3.8, 'M': 1.9, 'N': -3.5,
         'P': -1.6, 'Q': -3.5, 'R': -4.5, 'S': -0.8, 'T': -0.7, 'V': 4.2,
         'W': -0.9, 'Y': -1.3}

# Path: phydmslib/constants.py
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}
# 
# NT_TO_INDEX = {nt: i for (i, nt) in INDEX_TO_NT.items()}


# Path: phydmslib/weblogo.py
import collections
import os
import tempfile
import string
import math
import shutil
import natsort
import numpy
import matplotlib
import pylab
import PyPDF2
import weblogolib  # weblogo library
import weblogolib.colorscheme  # weblogo library
import corebio.matrix  # weblogo library
import corebio.utils  # weblogo library
    import doctest
from phydmslib.constants import AA_TO_INDEX, NT_TO_INDEX

        J. Kyte & R. F. Doolittle:
        "A simple method for displaying the hydropathic character of a
        protein." J Mol Biol, 157, 105-132

    More positive values indicate higher hydrophobicity,
    while more negative values indicate lower hydrophobicity.

    The returned variable is the 3-tuple *(cmap, mapping_d, mapper)*:

        * *cmap* is a ``pylab`` *LinearSegmentedColorMap* object.

        * *mapping_d* is a dictionary keyed by the one-letter amino-acid
          codes. The values are the colors in CSS2 format (e.g. #FF0000
          for red) for that amino acid. The value for a stop codon
          (denoted by a ``*`` character) is black (#000000).

        * *mapper* is the actual *pylab.cm.ScalarMappable* object.

    The optional argument *maptype* should specify a valid ``pylab`` color map.

    The optional calling argument *reverse* specifies that we set up the color
    map so that the most hydrophobic residue comes first (in the Kyte-Doolittle
    scale the most hydrophobic comes last as it has the largest value).
    This option is *True* by default as it seems more intuitive to have
    charged residues red and hydrophobic ones blue.
    """
    d = {'A': 1.8, 'C': 2.5, 'D': -3.5, 'E': -3.5, 'F': 2.8, 'G': -0.4,
         'H': -3.2, 'I': 4.5, 'K': -3.9, 'L': 3.8, 'M': 1.9, 'N': -3.5,
         'P': -1.6, 'Q': -3.5, 'R': -4.5, 'S': -0.8, 'T': -0.7, 'V': 4.2,
         'W': -0.9, 'Y': -1.3}

    aas = sorted(AA_TO_INDEX.keys())