# Path: q2_types/plugin_setup.py



import qiime2
import skbio.io
import qiime2.plugin.model as model
from qiime2.plugin import ValidationError
from ..plugin_setup import plugin
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------




class OrdinationFormat(model.TextFileFormat):
    def sniff(self):
        sniffer = skbio.io.io_registry.get_sniffer('ordination')
        return sniffer(str(self))[0]


OrdinationDirectoryFormat = model.SingleFileDirectoryFormat(
    'OrdinationDirectoryFormat', 'ordination.txt', OrdinationFormat)


class ProcrustesStatisticsFmt(model.TextFileFormat):
    METADATA_COLUMNS = {
        'true M^2 value',
        'p-value for true M^2 value',
        'number of Monte Carlo permutations',
    }

    def validate(self, level):
        try:
            md = qiime2.Metadata.load(str(self))

# Path: q2_types/plugin_setup.py



# Path: q2_types/ordination/_format.py
import qiime2
import skbio.io
import qiime2.plugin.model as model
from qiime2.plugin import ValidationError
from ..plugin_setup import plugin

# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------




class OrdinationFormat(model.TextFileFormat):
    def sniff(self):
        sniffer = skbio.io.io_registry.get_sniffer('ordination')
        return sniffer(str(self))[0]


OrdinationDirectoryFormat = model.SingleFileDirectoryFormat(
    'OrdinationDirectoryFormat', 'ordination.txt', OrdinationFormat)


class ProcrustesStatisticsFmt(model.TextFileFormat):
    METADATA_COLUMNS = {
        'true M^2 value',
        'p-value for true M^2 value',
        'number of Monte Carlo permutations',
    }

    def validate(self, level):
        try:
            md = qiime2.Metadata.load(str(self))

        except qiime2.metadata.MetadataFileError as md_exc: