# Path: q2_types/plugin_setup.py

# 
# Path: q2_types/ordination/_format.py
# class OrdinationFormat(model.TextFileFormat):
#     def sniff(self):
#         sniffer = skbio.io.io_registry.get_sniffer('ordination')
#         return sniffer(str(self))[0]
# 
# 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:
#             raise ValidationError(md_exc) from md_exc
# 
#         for column in sorted(self.METADATA_COLUMNS):
#             try:
#                 md.get_column(column)
#             except ValueError as md_exc:
#                 raise ValidationError(md_exc) from md_exc


import pandas as pd
import skbio
import qiime2
from ..plugin_setup import plugin
from . import OrdinationFormat, ProcrustesStatisticsFmt
    df.columns = ['Axis %d' % i for i in range(1, len(df.columns) + 1)]
    return df


@plugin.register_transformer
def _1(data: skbio.OrdinationResults) -> OrdinationFormat:
    ff = OrdinationFormat()
    data.write(str(ff), format='ordination')
    return ff


@plugin.register_transformer
def _2(ff: OrdinationFormat) -> skbio.OrdinationResults:
    return _ordination_format_to_ordination_results(ff)


@plugin.register_transformer
def _3(ff: OrdinationFormat) -> qiime2.Metadata:
    df = _ordination_format_to_dataframe(ff)
    return qiime2.Metadata(df)


@plugin.register_transformer
def _4(data: pd.DataFrame) -> ProcrustesStatisticsFmt:
    ff = ProcrustesStatisticsFmt()
    qiime2.Metadata(data).save(str(ff))
    return ff


@plugin.register_transformer

# Path: q2_types/plugin_setup.py

# 
# Path: q2_types/ordination/_format.py
# class OrdinationFormat(model.TextFileFormat):
#     def sniff(self):
#         sniffer = skbio.io.io_registry.get_sniffer('ordination')
#         return sniffer(str(self))[0]
# 
# 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:
#             raise ValidationError(md_exc) from md_exc
# 
#         for column in sorted(self.METADATA_COLUMNS):
#             try:
#                 md.get_column(column)
#             except ValueError as md_exc:
#                 raise ValidationError(md_exc) from md_exc


# Path: q2_types/ordination/_transformer.py
import pandas as pd
import skbio
import qiime2
from ..plugin_setup import plugin
from . import OrdinationFormat, ProcrustesStatisticsFmt

    df.columns = ['Axis %d' % i for i in range(1, len(df.columns) + 1)]
    return df


@plugin.register_transformer
def _1(data: skbio.OrdinationResults) -> OrdinationFormat:
    ff = OrdinationFormat()
    data.write(str(ff), format='ordination')
    return ff


@plugin.register_transformer
def _2(ff: OrdinationFormat) -> skbio.OrdinationResults:
    return _ordination_format_to_ordination_results(ff)


@plugin.register_transformer
def _3(ff: OrdinationFormat) -> qiime2.Metadata:
    df = _ordination_format_to_dataframe(ff)
    return qiime2.Metadata(df)


@plugin.register_transformer
def _4(data: pd.DataFrame) -> ProcrustesStatisticsFmt:
    ff = ProcrustesStatisticsFmt()
    qiime2.Metadata(data).save(str(ff))
    return ff


@plugin.register_transformer

def _5(ff: ProcrustesStatisticsFmt) -> pd.DataFrame: