# 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/utils/tags.py
# SEQITEM = 'seqitem'
# 
# SEQRECORD = 'seqrecord'
# 
# ILLUMINA_QUALITY = 'fastq-illumina'
# 
# SANGER_QUALITY = 'fastq'
# 
# SANGER_FASTQ_FORMATS = ('fastq-sanger', 'fastq')
# 
# ILLUMINA_FASTQ_FORMATS = ('fastq-illumina',)


from copy import deepcopy
from collections import namedtuple
from crumbs.utils.optional_modules import SeqRecord
from crumbs.utils.tags import (SEQITEM, SEQRECORD, ILLUMINA_QUALITY,
                               SANGER_QUALITY, SANGER_FASTQ_FORMATS,
                               ILLUMINA_FASTQ_FORMATS)
            quals = _int_quals_to_str_quals(int_quals, out_format)
    elif seq_class == SEQRECORD:
        int_quals = get_int_qualities(seq)
        quals = _int_quals_to_str_quals(int_quals, out_format)
    return quals


def get_annotations(seq):
    return seq.object.annotations


def _copy_seqrecord(seqrec, seq=None, name=None, id_=None):
    'Given a seqrecord it returns a new seqrecord with seq or qual changed.'
    if seq is None:
        seq = seqrec.seq
    if id_ is  None:
        id_ = seqrec.id
    if name is None:
        name = seqrec.name

    # the letter annotations
    let_annot = {annot: v for annot, v in seqrec.letter_annotations.items()}

    # the rest of parameters
    description = seqrec.description
    dbxrefs = seqrec.dbxrefs[:]
    features = seqrec.features[:]  # the features are not copied
    annotations = deepcopy(seqrec.annotations)

    # the new sequence

# 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/utils/tags.py
# SEQITEM = 'seqitem'
# 
# SEQRECORD = 'seqrecord'
# 
# ILLUMINA_QUALITY = 'fastq-illumina'
# 
# SANGER_QUALITY = 'fastq'
# 
# SANGER_FASTQ_FORMATS = ('fastq-sanger', 'fastq')
# 
# ILLUMINA_FASTQ_FORMATS = ('fastq-illumina',)


# Path: crumbs/seq/seq.py
from copy import deepcopy
from collections import namedtuple
from crumbs.utils.optional_modules import SeqRecord
from crumbs.utils.tags import (SEQITEM, SEQRECORD, ILLUMINA_QUALITY,
                               SANGER_QUALITY, SANGER_FASTQ_FORMATS,
                               ILLUMINA_FASTQ_FORMATS)

            quals = _int_quals_to_str_quals(int_quals, out_format)
    elif seq_class == SEQRECORD:
        int_quals = get_int_qualities(seq)
        quals = _int_quals_to_str_quals(int_quals, out_format)
    return quals


def get_annotations(seq):
    return seq.object.annotations


def _copy_seqrecord(seqrec, seq=None, name=None, id_=None):
    'Given a seqrecord it returns a new seqrecord with seq or qual changed.'
    if seq is None:
        seq = seqrec.seq
    if id_ is  None:
        id_ = seqrec.id
    if name is None:
        name = seqrec.name

    # the letter annotations
    let_annot = {annot: v for annot, v in seqrec.letter_annotations.items()}

    # the rest of parameters
    description = seqrec.description
    dbxrefs = seqrec.dbxrefs[:]
    features = seqrec.features[:]  # the features are not copied
    annotations = deepcopy(seqrec.annotations)

    # the new sequence

    new_seq = SeqRecord(seq=seq, id=id_, name=name, description=description,