# Path: simdna/simdnautil/util.py
# DEFAULT_LETTER_TO_INDEX = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
# DEFAULT_BACKGROUND_FREQ = OrderedDict(
#     [('A', 0.3), ('C', 0.2), ('G', 0.2), ('T', 0.3)])
# DEFAULT_DINUC_FREQ = OrderedDict([
#  ('AA',0.095),
#  ('AC',0.050),
#  ('AG',0.071),
#  ('AT',0.075),
#  ('CA',0.073),
#  ('CC',0.054),
#  ('CG',0.010),
#  ('CT',0.072),
#  ('GA',0.060),
#  ('GC',0.044),
#  ('GG',0.054),
#  ('GT',0.050),
#  ('TA',0.064),
#  ('TC',0.060),
#  ('TG',0.073),
#  ('TT',0.095),
# ])
# DEFAULT_BASE_DISCRETE_DISTRIBUTION = DiscreteDistribution(
#     DEFAULT_BACKGROUND_FREQ)
# class DiscreteDistribution(object):
# class VariableWrapper():
#     class Enum(object):
# class FileNameParts(object):
# class ArgumentToAdd(object):
# class FloatArgument(ArgumentToAdd):
# class BooleanArgument(ArgumentToAdd):
# class CoreFileNameArgument(ArgumentToAdd):
# class ArrArgument(ArgumentToAdd):
# class ArrOfFileNamesArgument(ArrArgument):
#     def __init__(self, valToFreq):
#     def sample(self):
# def get_file_handle(filename, mode="r"):
# def default_tab_seppd(s):
# def trim_newline(s):
# def perform_action_on_each_line_of_file(
#     file_handle, action, transformation=default_tab_seppd, ignore_input_title=False):
# def process_line(line, i, ignore_input_title,
#                  transformation, action):
#     def __init__(self, var):
# def enum(**enums):
# def combine_enums(*enums):
# def sampleFromProbsArr(arrWithProbs):
# def reverseComplement(sequence):
# def sampleWithoutReplacement(arr, numToSample):
# def swapIndices(arr, idx1, idx2):
# def get_file_name_parts(file_name):
#     def __init__(self, directory, core_file_name, extension):
#     def get_full_path(self):
#     def get_core_file_name_and_extension(self):
#     def get_transformed_core_file_name(self, transformation, extension=None):
#     def get_transformed_file_path(self, transformation, extension=None):
# def format_as_json(jsonable_data):
#     def __init__(self, val, argumentName=None, argNameAndValSep="-"):
#     def argNamePrefix(self):
#     def transform(self):
#     def __init__(self, val, argumentName=None, argNameAndValSep="-"):
#     def argNamePrefix(self):
#     def transform(self):
#     def transform(self):
#     def transform(self):
#     def __init__(self, val, argumentName, sep="+", toStringFunc=str):
#     def transform(self):
#     def __init__(self, val, argumentName, sep="+"):
# def addArguments(string, args, joiner="_"):


from simdna.simdnautil import util
from collections import OrderedDict
            from simdna.synthetic.embeddables import StringEmbeddable
import numpy as np
import re
import itertools
def printSequences(outputFileName, sequenceSetGenerator,
                   includeEmbeddings=False, labelGenerator=None,
                   includeFasta=False, prefix=None):
    """Print a series of synthetic sequences.

    Given an output filename, and an instance of
        :class:`.AbstractSequenceSetGenerator`, will call the
        sequenceSetGenerator and print the generated sequences
        to the output file. Will also create a file "info_outputFileName.txt"
        in the same directory as outputFileName that contains
        all the information about sequenceSetGenerator.

    Arguments:
        outputFileName: string

        sequenceSetGenerator: instance of
            :class:`.AbstractSequenceSetGenerator`
    
        includeEmbeddings: a boolean indicating whether to print a
            column that lists the embeddings
    
        labelGenerator: optional instance of :class:`.LabelGenerator`

        includeFasta: optional boolean indicating whether to also
            print out the generated sequences in fasta format
            (the file will be produced with a .fa extension)

        prefix: string - this will be prefixed in front of the generated
            sequence ids, followed by a hyphen
    """

# Path: simdna/simdnautil/util.py
# DEFAULT_LETTER_TO_INDEX = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
# DEFAULT_BACKGROUND_FREQ = OrderedDict(
#     [('A', 0.3), ('C', 0.2), ('G', 0.2), ('T', 0.3)])
# DEFAULT_DINUC_FREQ = OrderedDict([
#  ('AA',0.095),
#  ('AC',0.050),
#  ('AG',0.071),
#  ('AT',0.075),
#  ('CA',0.073),
#  ('CC',0.054),
#  ('CG',0.010),
#  ('CT',0.072),
#  ('GA',0.060),
#  ('GC',0.044),
#  ('GG',0.054),
#  ('GT',0.050),
#  ('TA',0.064),
#  ('TC',0.060),
#  ('TG',0.073),
#  ('TT',0.095),
# ])
# DEFAULT_BASE_DISCRETE_DISTRIBUTION = DiscreteDistribution(
#     DEFAULT_BACKGROUND_FREQ)
# class DiscreteDistribution(object):
# class VariableWrapper():
#     class Enum(object):
# class FileNameParts(object):
# class ArgumentToAdd(object):
# class FloatArgument(ArgumentToAdd):
# class BooleanArgument(ArgumentToAdd):
# class CoreFileNameArgument(ArgumentToAdd):
# class ArrArgument(ArgumentToAdd):
# class ArrOfFileNamesArgument(ArrArgument):
#     def __init__(self, valToFreq):
#     def sample(self):
# def get_file_handle(filename, mode="r"):
# def default_tab_seppd(s):
# def trim_newline(s):
# def perform_action_on_each_line_of_file(
#     file_handle, action, transformation=default_tab_seppd, ignore_input_title=False):
# def process_line(line, i, ignore_input_title,
#                  transformation, action):
#     def __init__(self, var):
# def enum(**enums):
# def combine_enums(*enums):
# def sampleFromProbsArr(arrWithProbs):
# def reverseComplement(sequence):
# def sampleWithoutReplacement(arr, numToSample):
# def swapIndices(arr, idx1, idx2):
# def get_file_name_parts(file_name):
#     def __init__(self, directory, core_file_name, extension):
#     def get_full_path(self):
#     def get_core_file_name_and_extension(self):
#     def get_transformed_core_file_name(self, transformation, extension=None):
#     def get_transformed_file_path(self, transformation, extension=None):
# def format_as_json(jsonable_data):
#     def __init__(self, val, argumentName=None, argNameAndValSep="-"):
#     def argNamePrefix(self):
#     def transform(self):
#     def __init__(self, val, argumentName=None, argNameAndValSep="-"):
#     def argNamePrefix(self):
#     def transform(self):
#     def transform(self):
#     def transform(self):
#     def __init__(self, val, argumentName, sep="+", toStringFunc=str):
#     def transform(self):
#     def __init__(self, val, argumentName, sep="+"):
# def addArguments(string, args, joiner="_"):


# Path: simdna/synthetic/core.py
from simdna.simdnautil import util
from collections import OrderedDict
            from simdna.synthetic.embeddables import StringEmbeddable
import numpy as np
import re
import itertools

def printSequences(outputFileName, sequenceSetGenerator,
                   includeEmbeddings=False, labelGenerator=None,
                   includeFasta=False, prefix=None):
    """Print a series of synthetic sequences.

    Given an output filename, and an instance of
        :class:`.AbstractSequenceSetGenerator`, will call the
        sequenceSetGenerator and print the generated sequences
        to the output file. Will also create a file "info_outputFileName.txt"
        in the same directory as outputFileName that contains
        all the information about sequenceSetGenerator.

    Arguments:
        outputFileName: string

        sequenceSetGenerator: instance of
            :class:`.AbstractSequenceSetGenerator`
    
        includeEmbeddings: a boolean indicating whether to print a
            column that lists the embeddings
    
        labelGenerator: optional instance of :class:`.LabelGenerator`

        includeFasta: optional boolean indicating whether to also
            print out the generated sequences in fasta format
            (the file will be produced with a .fa extension)

        prefix: string - this will be prefixed in front of the generated
            sequence ids, followed by a hyphen
    """

    ofh = util.get_file_handle(outputFileName, 'w')