# Path: crumbs/utils/optional_modules.py
# MSG = 'A python package to run this executable is required,'
# BIO = 'biopython'
# BIO_BGZF = 'biopython with Bgzf support'
#     NCBIXML = create_fake_class(MSG + BIO)
#     NCBIWWW = create_fake_class(MSG + BIO)
# def create_fake_class(msg):
#         def __init__(self, *args, **kwargs):
# def create_fake_funct(msg):
#     def FakeRequiredfunct(*args, **kwargs):
#     class FakePythonRequiredClass(object):


from array import array
from crumbs.utils.optional_modules import SffIterator
            annots['clip_adapter_left'] = clip
            seq = seq[:clip].lower() + seq[clip:].upper()
            quals = record.letter_annotations['phred_quality']
            record.letter_annotations = {}
            record.seq = seq
            dict.__setitem__(record._per_letter_annotations,
                             "phred_quality", quals)
        yield record


class SffExtractor(object):
    'This class extracts the reads from an SFF file'
    def __init__(self, sff_fhands, trim=False, min_left_clip=0,
                 nucls_to_check=50, max_nucl_freq_threshold=0.5):
        'It inits the class'
        self.fhands = sff_fhands
        self.trim = trim
        self.min_left_clip = min_left_clip

        # checking
        self.nucls_to_check = nucls_to_check
        self.max_nucl_freq_threshold = max_nucl_freq_threshold
        self.nucl_counts = {}

    @property
    def seqs(self):
        'It yields all sequences'
        for fhand in self.fhands:
            self._prepare_nucl_counts(fhand.name)
            if not self.min_left_clip:

# Path: crumbs/utils/optional_modules.py
# MSG = 'A python package to run this executable is required,'
# BIO = 'biopython'
# BIO_BGZF = 'biopython with Bgzf support'
#     NCBIXML = create_fake_class(MSG + BIO)
#     NCBIWWW = create_fake_class(MSG + BIO)
# def create_fake_class(msg):
#         def __init__(self, *args, **kwargs):
# def create_fake_funct(msg):
#     def FakeRequiredfunct(*args, **kwargs):
#     class FakePythonRequiredClass(object):


# Path: crumbs/seq/sff_extract.py
from array import array
from crumbs.utils.optional_modules import SffIterator

            annots['clip_adapter_left'] = clip
            seq = seq[:clip].lower() + seq[clip:].upper()
            quals = record.letter_annotations['phred_quality']
            record.letter_annotations = {}
            record.seq = seq
            dict.__setitem__(record._per_letter_annotations,
                             "phred_quality", quals)
        yield record


class SffExtractor(object):
    'This class extracts the reads from an SFF file'
    def __init__(self, sff_fhands, trim=False, min_left_clip=0,
                 nucls_to_check=50, max_nucl_freq_threshold=0.5):
        'It inits the class'
        self.fhands = sff_fhands
        self.trim = trim
        self.min_left_clip = min_left_clip

        # checking
        self.nucls_to_check = nucls_to_check
        self.max_nucl_freq_threshold = max_nucl_freq_threshold
        self.nucl_counts = {}

    @property
    def seqs(self):
        'It yields all sequences'
        for fhand in self.fhands:
            self._prepare_nucl_counts(fhand.name)
            if not self.min_left_clip:

                seqs = SffIterator(fhand, trim=self.trim)