Skip to content

Commit

Permalink
REF: distance_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ebolyen committed Jul 22, 2024
1 parent ccd25ff commit 040988e
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 18 deletions.
1 change: 0 additions & 1 deletion q2_types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
importlib.import_module('q2_types.per_sample_sequences')
importlib.import_module('q2_types.feature_map')
importlib.import_module('q2_types.feature_table')
importlib.import_module('q2_types.distance_matrix')
importlib.import_module('q2_types.tree')
importlib.import_module('q2_types.ordination')
importlib.import_module('q2_types.sample_data')
Expand Down
8 changes: 2 additions & 6 deletions q2_types/distance_matrix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------

import importlib

from ._format import LSMatFormat, DistanceMatrixDirectoryFormat
from ._type import DistanceMatrix
from ._formats import LSMatFormat, DistanceMatrixDirectoryFormat
from ._types import DistanceMatrix

__all__ = ['LSMatFormat', 'DistanceMatrixDirectoryFormat', 'DistanceMatrix']

importlib.import_module('q2_types.distance_matrix._transformer')
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------

from qiime2.plugin import SemanticType
import importlib

from ..plugin_setup import plugin
from . import DistanceMatrixDirectoryFormat
from .. import LSMatFormat, DistanceMatrixDirectoryFormat
from .. import DistanceMatrix

from ...plugin_setup import plugin

DistanceMatrix = SemanticType('DistanceMatrix')
plugin.register_formats(LSMatFormat, DistanceMatrixDirectoryFormat)

plugin.register_semantic_types(DistanceMatrix)

plugin.register_artifact_class(
DistanceMatrix,
directory_format=DistanceMatrixDirectoryFormat,
description="A symmetric matrix representing distances between entities."
)

importlib.import_module('._transformers', __name__)
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

import skbio

from ..plugin_setup import plugin
from . import LSMatFormat
from .. import LSMatFormat

from ...plugin_setup import plugin


@plugin.register_transformer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import skbio.io
import qiime2.plugin.model as model

from ..plugin_setup import plugin


class LSMatFormat(model.TextFileFormat):
def sniff(self):
Expand All @@ -20,6 +18,3 @@ def sniff(self):

DistanceMatrixDirectoryFormat = model.SingleFileDirectoryFormat(
'DistanceMatrixDirectoryFormat', 'distance-matrix.tsv', LSMatFormat)


plugin.register_formats(LSMatFormat, DistanceMatrixDirectoryFormat)
12 changes: 12 additions & 0 deletions q2_types/distance_matrix/_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2023, 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.
# ----------------------------------------------------------------------------

from qiime2.plugin import SemanticType


DistanceMatrix = SemanticType('DistanceMatrix')
File renamed without changes.
1 change: 1 addition & 0 deletions q2_types/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
citations=[citations['mckinney-proc-scipy-2010']])

importlib.import_module('q2_types.bowtie2._deferred_setup')
importlib.import_module('q2_types.distance_matrix._deferred_setup')

0 comments on commit 040988e

Please sign in to comment.