# Path: q2_types/plugin_setup.py

# 
# Path: q2_types/tree/_format.py
# class NewickFormat(model.TextFileFormat):
#     def sniff(self):
#         sniffer = skbio.io.io_registry.get_sniffer('newick')
#         return sniffer(str(self))[0]


import skbio
from ..plugin_setup import plugin
from . import NewickFormat
# ----------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------




@plugin.register_transformer
def _1(data: skbio.TreeNode) -> NewickFormat:
    ff = NewickFormat()
    with ff.open() as fh:

# Path: q2_types/plugin_setup.py

# 
# Path: q2_types/tree/_format.py
# class NewickFormat(model.TextFileFormat):
#     def sniff(self):
#         sniffer = skbio.io.io_registry.get_sniffer('newick')
#         return sniffer(str(self))[0]


# Path: q2_types/tree/_transformer.py
import skbio
from ..plugin_setup import plugin
from . import NewickFormat

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




@plugin.register_transformer
def _1(data: skbio.TreeNode) -> NewickFormat:
    ff = NewickFormat()
    with ff.open() as fh:

        data.write(fh, format='newick')