# Path: alfpy/word_pattern.py
# class Pattern:
#     def __init__(self, pat_list, occr_list, pos_list=None):
#     def _alfree_format(self):
#     def _teiresias_format(self):
#     def format(self, formattype=None):
#     def reduce_alphabet(self, alphabet_dict):
#     def merge_revcomp(self):
#         def revcomp(s):
#     def __repr__(self):
#     def __str__(self):
# def _create_wordpattern(seq_list, k):
# def _create_wordpattern_positions(seq_list, k):
# def create(seq_list, word_size=1, wordpos=False):
# def create_from_fasta(handle, word_size=1, wordpos=False):
# def create_from_bigfasta(filename, k=1):
# def run_teiresias(input_filename, w=2, l=2, k=2, output_filename=None):
# def read(handle):
# def main():


import os
import unittest
from alfpy import word_pattern
from . import utils
            '1 2 10'
        ]
        self.assertEqual(p.format('teiresias'), "\n".join(exp))
        

    def test_word_pattern_create_wordsize2_wordposFalse(self):
        p = word_pattern.create(self.dna_records.seq_list,
                                word_size=2,
                                wordpos=False)
        exp = ["8\t3\tTA 0:3 1:3 2:2",
               "7\t3\tAC 0:4 1:1 2:2",
               "7\t3\tGG 0:1 1:4 2:2",
               "4\t3\tAG 0:1 1:2 2:1",
               "4\t2\tCT 1:3 2:1",
               "3\t3\tAT 0:1 1:1 2:1",
               "3\t3\tGA 0:1 1:1 2:1",
               "3\t2\tAA 0:2 2:1",
               "3\t2\tCA 0:1 2:2",
               "3\t2\tCC 0:2 2:1",
               "3\t1\tCG 0:3",
               "3\t1\tGT 0:3",
               "2\t2\tTT 0:1 1:1",
               "1\t1\tTC 1:1",
               "1\t1\tTG 0:1",
               ]
        self.assertEqual(p.format(), "\n".join(exp))

    def test_input_output_file_pattern(self):

        for wordpos in [True, False]:

# Path: alfpy/word_pattern.py
# class Pattern:
#     def __init__(self, pat_list, occr_list, pos_list=None):
#     def _alfree_format(self):
#     def _teiresias_format(self):
#     def format(self, formattype=None):
#     def reduce_alphabet(self, alphabet_dict):
#     def merge_revcomp(self):
#         def revcomp(s):
#     def __repr__(self):
#     def __str__(self):
# def _create_wordpattern(seq_list, k):
# def _create_wordpattern_positions(seq_list, k):
# def create(seq_list, word_size=1, wordpos=False):
# def create_from_fasta(handle, word_size=1, wordpos=False):
# def create_from_bigfasta(filename, k=1):
# def run_teiresias(input_filename, w=2, l=2, k=2, output_filename=None):
# def read(handle):
# def main():


# Path: tests/test_word_pattern.py
import os
import unittest
from alfpy import word_pattern
from . import utils

            '1 2 10'
        ]
        self.assertEqual(p.format('teiresias'), "\n".join(exp))
        

    def test_word_pattern_create_wordsize2_wordposFalse(self):
        p = word_pattern.create(self.dna_records.seq_list,
                                word_size=2,
                                wordpos=False)
        exp = ["8\t3\tTA 0:3 1:3 2:2",
               "7\t3\tAC 0:4 1:1 2:2",
               "7\t3\tGG 0:1 1:4 2:2",
               "4\t3\tAG 0:1 1:2 2:1",
               "4\t2\tCT 1:3 2:1",
               "3\t3\tAT 0:1 1:1 2:1",
               "3\t3\tGA 0:1 1:1 2:1",
               "3\t2\tAA 0:2 2:1",
               "3\t2\tCA 0:1 2:2",
               "3\t2\tCC 0:2 2:1",
               "3\t1\tCG 0:3",
               "3\t1\tGT 0:3",
               "2\t2\tTT 0:1 1:1",
               "1\t1\tTC 1:1",
               "1\t1\tTG 0:1",
               ]
        self.assertEqual(p.format(), "\n".join(exp))

    def test_input_output_file_pattern(self):

        for wordpos in [True, False]:

            p1 = word_pattern.create(self.dna_records.seq_list,