# Path: engine/conf.py
# PATH_TO_IMG = PATH + '/notes/'
# 
# PATH_TO_MD = PATH + '/notes/'
# 
# PATH_TO_ORIG = PATH + "/engine/data/orig/"


from engine.conf import PATH_TO_IMG, PATH_TO_MD, PATH_TO_ORIG
                from Bio.Seq import Seq
                from Bio.Alphabet import generic_dna, generic_protein
import re
import os
import codecs
import glob
import logging
#!/usr/bin/python3
# -*- coding: utf-8 -*-

"""This is a set of functions that work on Markdown file, before compiling them to html.

Go to page.py (Page) pre_process to add a new function from here."""


logger = logging.getLogger('geekbook')
logger.setLevel(logging.INFO)

FLASK_BASED = True

def color_seq_protein(seq):
    seq_txt = ''
    protein = True
    logging.info(seq)
    raw_seq = seq.split('#')[0]
    for s in seq:
        if protein:
            if s.lower() in ["k", "r", "h"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: DodgerBlue;">' + s + '</span>'
            elif s.lower() in ["T", "t"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: green;">' + s + '</span>'
            elif s.lower() in ["d", "e"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: red;">' + s + '</span>'
            elif s.lower() in ["w", "y"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: yellow;">' + s + '</span>'

# Path: engine/conf.py
# PATH_TO_IMG = PATH + '/notes/'
# 
# PATH_TO_MD = PATH + '/notes/'
# 
# PATH_TO_ORIG = PATH + "/engine/data/orig/"


# Path: engine/preprocessing.py
from engine.conf import PATH_TO_IMG, PATH_TO_MD, PATH_TO_ORIG
                from Bio.Seq import Seq
                from Bio.Alphabet import generic_dna, generic_protein
import re
import os
import codecs
import glob
import logging

#!/usr/bin/python3
# -*- coding: utf-8 -*-

"""This is a set of functions that work on Markdown file, before compiling them to html.

Go to page.py (Page) pre_process to add a new function from here."""


logger = logging.getLogger('geekbook')
logger.setLevel(logging.INFO)

FLASK_BASED = True

def color_seq_protein(seq):
    seq_txt = ''
    protein = True
    logging.info(seq)
    raw_seq = seq.split('#')[0]
    for s in seq:
        if protein:
            if s.lower() in ["k", "r", "h"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: DodgerBlue;">' + s + '</span>'
            elif s.lower() in ["T", "t"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: green;">' + s + '</span>'
            elif s.lower() in ["d", "e"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: red;">' + s + '</span>'
            elif s.lower() in ["w", "y"]:
                seq_txt += '<span style="font-family: Menlo,Monaco,Consolas,Courier New,monospace; background-color: yellow;">' + s + '</span>'

            elif s.lower() in ["m"]: