#!/usr/bin/python

import re

enzymes = {
    'BclI':    'TGATCA',
    'BfmI':    'CTRYAG',
    'Cac8I':   'GCNNGC',
    'EcoRI':   'GAATTC',
    'HindIII': 'AAGCTT',
    }

enzymes_mod = enzymes.copy()

amb = {
    'R': '[AG]',
    'Y': '[CT]',
    'N': '[AGCT]',
    'W': '[AT]',
    'M': '[AC]',
    'S': '[CG]',
    'K': '[TG]',
    'V': '[ACG]',
    'H': '[ACT]',
    'D': '[AGT]',
    'B': '[CGT]',
    }

for key in enzymes_mod.keys():
    for ambkey in amb.keys():
        enzymes_mod[key] = enzymes_mod[key].replace(ambkey, amb[ambkey])

seq = 'GATCTGACTAGCGAGCGTGATCAAGCTTGTGTAGGAATTCCTTGATGCTGTAGCGCGAGCTGA'

for i in range(0, len(seq) - 6):
    testseq = seq[i:i + 6]
    for key in enzymes_mod.keys():
        if re.search(enzymes_mod[key], testseq):
            pos = i + 1
            print key, '\t', pos, '\t', testseq, '\t', enzymes[key]