# Path: q2_types/per_sample_sequences/_format.py
# class FastqAbsolutePathManifestFormatV2(model.TextFileFormat):
# class _SingleEndFastqManifestV2(FastqAbsolutePathManifestFormatV2):
# class SingleEndFastqManifestPhred33V2(_SingleEndFastqManifestV2):
# class SingleEndFastqManifestPhred64V2(_SingleEndFastqManifestV2):
# class _PairedEndFastqManifestV2(FastqAbsolutePathManifestFormatV2):
# class PairedEndFastqManifestPhred33V2(_PairedEndFastqManifestV2):
# class PairedEndFastqManifestPhred64V2(_PairedEndFastqManifestV2):
# class _FastqManifestBase(model.TextFileFormat):
# class FastqManifestFormat(_FastqManifestBase):
# class FastqAbsolutePathManifestFormat(_FastqManifestBase):
# class SingleEndFastqManifestPhred33(FastqAbsolutePathManifestFormat):
# class SingleEndFastqManifestPhred64(FastqAbsolutePathManifestFormat):
# class PairedEndFastqManifestPhred33(FastqAbsolutePathManifestFormat):
# class PairedEndFastqManifestPhred64(FastqAbsolutePathManifestFormat):
# class YamlFormat(model.TextFileFormat):
# class FastqGzFormat(model.BinaryFileFormat):
# class CasavaOneEightSingleLanePerSampleDirFmt(model.DirectoryFormat):
# class _SingleLanePerSampleFastqDirFmt(CasavaOneEightSingleLanePerSampleDirFmt):
# class SingleLanePerSampleSingleEndFastqDirFmt(_SingleLanePerSampleFastqDirFmt):
# class SingleLanePerSamplePairedEndFastqDirFmt(_SingleLanePerSampleFastqDirFmt):
# class CasavaOneEightLanelessPerSampleDirFmt(model.DirectoryFormat):
# class QIIME1DemuxFormat(model.TextFileFormat):
#     METADATA_COLUMNS = None
#     METADATA_COLUMNS = {'absolute-filepath': 'forward'}
#     METADATA_COLUMNS = {'forward-absolute-filepath': 'forward',
#                         'reverse-absolute-filepath': 'reverse'}
#     EXPECTED_HEADER = None
#     PATH_HEADER_LABEL = None
#     EXPECTED_HEADER = ['sample-id', 'filename', 'direction']
#     PATH_HEADER_LABEL = 'filename'
#     EXPECTED_HEADER = ['sample-id', 'absolute-filepath', 'direction']
#     PATH_HEADER_LABEL = 'absolute-filepath'
#     _CHECK_PAIRED = True
#     _REQUIRE_PAIRED = False
#     _CHECK_PAIRED = False
#     _REQUIRE_PAIRED = True
#     def _validate_(self, level):
#     def _check_n_records(self, root, n=None):
#     def _validate_(self, level):
#     def _validate_(self, level):
#     def sniff(self):
#     def _check_n_records(self, n=None):
#     def _validate_(self, level):
#     def sequences_path_maker(self, sample_id, barcode_id, lane_number,
#                              read_number):
#     def _find_duplicates(self, ids):
#     def manifest(self):
#         def munge_fn_closure(val):
#     def _validate_(self, level):
#     def sequences_path_maker(self, sample_id, barcode_id, read_number):
#     def sniff(self):
#     def _validate(self, filehandle, *, num_records):
#     def _parse_id(self, header):
#     def _validate_id(self, id):
#     def _validate_seq(self, seq):


import os.path
import shutil
import unittest
import string
import pandas as pd
from q2_types.per_sample_sequences import (
    CasavaOneEightSingleLanePerSampleDirFmt,
    CasavaOneEightLanelessPerSampleDirFmt,
    FastqGzFormat, YamlFormat, FastqManifestFormat,
    FastqAbsolutePathManifestFormat,
    SingleEndFastqManifestPhred33, SingleEndFastqManifestPhred64,
    PairedEndFastqManifestPhred33, PairedEndFastqManifestPhred64,
    SingleEndFastqManifestPhred33V2, SingleEndFastqManifestPhred64V2,
    PairedEndFastqManifestPhred33V2, PairedEndFastqManifestPhred64V2,
    SingleLanePerSampleSingleEndFastqDirFmt,
    SingleLanePerSamplePairedEndFastqDirFmt,
    QIIME1DemuxFormat, QIIME1DemuxDirFmt
)
from qiime2.plugin.testing import TestPluginBase
from qiime2.plugin import ValidationError
        format = CasavaOneEightSingleLanePerSampleDirFmt(self.temp_dir.name,
                                                         mode='r')

        with self.assertRaisesRegex(ValidationError, 'matching.*Human-Other'):
            format.validate()

    def test_casava_one_eight_slanepsample_dir_fmt_duplicate_forwards(self):
        f = self.get_data_path('Human-Kneecap_S1_L001_R1_001.fastq.gz')

        shutil.copy(f, self.temp_dir.name)
        shutil.copy(
            f, os.path.join(self.temp_dir.name,
                            'Human-Kneecap_S2_L001_R1_001.fastq.gz'))

        format = CasavaOneEightSingleLanePerSampleDirFmt(self.temp_dir.name,
                                                         mode='r')

        with self.assertRaisesRegex(ValidationError,
                                    'Duplicate.*Human-Kneecap'):
            format.validate()

    def test_casava_one_eight_slanepsample_dir_fmt_duplicate_reverse(self):
        r = self.get_data_path(
            'paired_end_data/Human-Kneecap_S1_L001_R2_001.fastq.gz')

        shutil.copy(r, self.temp_dir.name)
        shutil.copy(
            r, os.path.join(self.temp_dir.name,
                            'Human-Kneecap_S2_L001_R2_001.fastq.gz'))


# Path: q2_types/per_sample_sequences/_format.py
# class FastqAbsolutePathManifestFormatV2(model.TextFileFormat):
# class _SingleEndFastqManifestV2(FastqAbsolutePathManifestFormatV2):
# class SingleEndFastqManifestPhred33V2(_SingleEndFastqManifestV2):
# class SingleEndFastqManifestPhred64V2(_SingleEndFastqManifestV2):
# class _PairedEndFastqManifestV2(FastqAbsolutePathManifestFormatV2):
# class PairedEndFastqManifestPhred33V2(_PairedEndFastqManifestV2):
# class PairedEndFastqManifestPhred64V2(_PairedEndFastqManifestV2):
# class _FastqManifestBase(model.TextFileFormat):
# class FastqManifestFormat(_FastqManifestBase):
# class FastqAbsolutePathManifestFormat(_FastqManifestBase):
# class SingleEndFastqManifestPhred33(FastqAbsolutePathManifestFormat):
# class SingleEndFastqManifestPhred64(FastqAbsolutePathManifestFormat):
# class PairedEndFastqManifestPhred33(FastqAbsolutePathManifestFormat):
# class PairedEndFastqManifestPhred64(FastqAbsolutePathManifestFormat):
# class YamlFormat(model.TextFileFormat):
# class FastqGzFormat(model.BinaryFileFormat):
# class CasavaOneEightSingleLanePerSampleDirFmt(model.DirectoryFormat):
# class _SingleLanePerSampleFastqDirFmt(CasavaOneEightSingleLanePerSampleDirFmt):
# class SingleLanePerSampleSingleEndFastqDirFmt(_SingleLanePerSampleFastqDirFmt):
# class SingleLanePerSamplePairedEndFastqDirFmt(_SingleLanePerSampleFastqDirFmt):
# class CasavaOneEightLanelessPerSampleDirFmt(model.DirectoryFormat):
# class QIIME1DemuxFormat(model.TextFileFormat):
#     METADATA_COLUMNS = None
#     METADATA_COLUMNS = {'absolute-filepath': 'forward'}
#     METADATA_COLUMNS = {'forward-absolute-filepath': 'forward',
#                         'reverse-absolute-filepath': 'reverse'}
#     EXPECTED_HEADER = None
#     PATH_HEADER_LABEL = None
#     EXPECTED_HEADER = ['sample-id', 'filename', 'direction']
#     PATH_HEADER_LABEL = 'filename'
#     EXPECTED_HEADER = ['sample-id', 'absolute-filepath', 'direction']
#     PATH_HEADER_LABEL = 'absolute-filepath'
#     _CHECK_PAIRED = True
#     _REQUIRE_PAIRED = False
#     _CHECK_PAIRED = False
#     _REQUIRE_PAIRED = True
#     def _validate_(self, level):
#     def _check_n_records(self, root, n=None):
#     def _validate_(self, level):
#     def _validate_(self, level):
#     def sniff(self):
#     def _check_n_records(self, n=None):
#     def _validate_(self, level):
#     def sequences_path_maker(self, sample_id, barcode_id, lane_number,
#                              read_number):
#     def _find_duplicates(self, ids):
#     def manifest(self):
#         def munge_fn_closure(val):
#     def _validate_(self, level):
#     def sequences_path_maker(self, sample_id, barcode_id, read_number):
#     def sniff(self):
#     def _validate(self, filehandle, *, num_records):
#     def _parse_id(self, header):
#     def _validate_id(self, id):
#     def _validate_seq(self, seq):


# Path: q2_types/per_sample_sequences/tests/test_format.py
import os.path
import shutil
import unittest
import string
import pandas as pd
from q2_types.per_sample_sequences import (
    CasavaOneEightSingleLanePerSampleDirFmt,
    CasavaOneEightLanelessPerSampleDirFmt,
    FastqGzFormat, YamlFormat, FastqManifestFormat,
    FastqAbsolutePathManifestFormat,
    SingleEndFastqManifestPhred33, SingleEndFastqManifestPhred64,
    PairedEndFastqManifestPhred33, PairedEndFastqManifestPhred64,
    SingleEndFastqManifestPhred33V2, SingleEndFastqManifestPhred64V2,
    PairedEndFastqManifestPhred33V2, PairedEndFastqManifestPhred64V2,
    SingleLanePerSampleSingleEndFastqDirFmt,
    SingleLanePerSamplePairedEndFastqDirFmt,
    QIIME1DemuxFormat, QIIME1DemuxDirFmt
)
from qiime2.plugin.testing import TestPluginBase
from qiime2.plugin import ValidationError

        format = CasavaOneEightSingleLanePerSampleDirFmt(self.temp_dir.name,
                                                         mode='r')

        with self.assertRaisesRegex(ValidationError, 'matching.*Human-Other'):
            format.validate()

    def test_casava_one_eight_slanepsample_dir_fmt_duplicate_forwards(self):
        f = self.get_data_path('Human-Kneecap_S1_L001_R1_001.fastq.gz')

        shutil.copy(f, self.temp_dir.name)
        shutil.copy(
            f, os.path.join(self.temp_dir.name,
                            'Human-Kneecap_S2_L001_R1_001.fastq.gz'))

        format = CasavaOneEightSingleLanePerSampleDirFmt(self.temp_dir.name,
                                                         mode='r')

        with self.assertRaisesRegex(ValidationError,
                                    'Duplicate.*Human-Kneecap'):
            format.validate()

    def test_casava_one_eight_slanepsample_dir_fmt_duplicate_reverse(self):
        r = self.get_data_path(
            'paired_end_data/Human-Kneecap_S1_L001_R2_001.fastq.gz')

        shutil.copy(r, self.temp_dir.name)
        shutil.copy(
            r, os.path.join(self.temp_dir.name,
                            'Human-Kneecap_S2_L001_R2_001.fastq.gz'))


        format = CasavaOneEightSingleLanePerSampleDirFmt(self.temp_dir.name,