from __future__ import absolute_import
from seqtables.core.utils.insilica_sequences import generate_sequence, generate_library, add_quality_scores


def create_scratch_data(num_seqs, seq_len, ss_pos=[], error_prone_rate=0.01):
    """
        Create a set of fake sequences generated by site saturation of a wild type sequence and error prone

        Args:
            num_seqs (int): number of sequences to make
            seq_len (int): length of sequence
            ss_pos (list of ints): positions within sequence that will be site saturated
            error_prone_rate (float): frequency of error prone mutations

        Returns:
            seqtable instance: sequences represented as a seqtable
            wt_seq (string): the reference sequence used to generate the seqtable
    """
    wt_seq = generate_sequence(seq_len=300)
    lib = generate_library(
        wt_seq,
        num_seqs,
        error_prone_rate=error_prone_rate,
        ss_pos=ss_pos,
        return_as='seq'
    )
    qual = add_quality_scores(lib, read_type='r1')
    return lib, qual, wt_seq

