# 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)
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR  PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with seq_crumbs. If not, see <http://www.gnu.org/licenses/>.



# pylint: disable=C0111


SeqWrapper = namedtuple('SeqWrapper', ['kind', 'object', 'file_format'])
_SeqItem = namedtuple('SeqItem', ['name', 'lines', 'annotations'])


class SeqItem(_SeqItem):
    def __new__(cls, name, lines, annotations=None):
        # This subclass is required to have a default value in a namedtuple
        if annotations is None:
            annotations = {}
        # add default values
        return super(SeqItem, cls).__new__(cls, name, lines, annotations)


def get_title(seq):
    'Given a seq it returns the title'
    seq_class = seq.kind
    seq = seq.object


# 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)

# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR  PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with seq_crumbs. If not, see <http://www.gnu.org/licenses/>.



# pylint: disable=C0111


SeqWrapper = namedtuple('SeqWrapper', ['kind', 'object', 'file_format'])
_SeqItem = namedtuple('SeqItem', ['name', 'lines', 'annotations'])


class SeqItem(_SeqItem):
    def __new__(cls, name, lines, annotations=None):
        # This subclass is required to have a default value in a namedtuple
        if annotations is None:
            annotations = {}
        # add default values
        return super(SeqItem, cls).__new__(cls, name, lines, annotations)


def get_title(seq):
    'Given a seq it returns the title'
    seq_class = seq.kind
    seq = seq.object


    if seq_class == SEQITEM: