Skip to content

Commit

Permalink
Merge cab3b1a into 2946fda
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Simpson committed Aug 7, 2020
2 parents 2946fda + cab3b1a commit eef11a5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions q2_types/feature_table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
BIOMV210DirFmt)
from ._type import (FeatureTable, Frequency, RelativeFrequency,
PresenceAbsence, Composition, Balance,
PercentileNormalized)
PercentileNormalized, Design)

__all__ = ['BIOMV100Format', 'BIOMV100DirFmt', 'FeatureTable', 'Frequency',
'RelativeFrequency', 'PresenceAbsence', 'BIOMV210Format',
'BIOMV210DirFmt', 'Composition', 'Balance', 'PercentileNormalized']
'BIOMV210DirFmt', 'Composition', 'Balance', 'PercentileNormalized',
'Design']

importlib.import_module('q2_types.feature_table._transformer')
8 changes: 6 additions & 2 deletions q2_types/feature_table/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@
PercentileNormalized = SemanticType('PercentileNormalized',
variant_of=FeatureTable.field['content'])

# Design is the type of design matrices for linear regressions that have
# been transformed/coded.
Design = SemanticType('Design', variant_of=FeatureTable.field['content'])

plugin.register_semantic_types(FeatureTable, Frequency, RelativeFrequency,
PresenceAbsence, Balance, Composition,
PercentileNormalized)
PercentileNormalized, Design)

plugin.register_semantic_type_to_format(
FeatureTable[Frequency | RelativeFrequency |
PresenceAbsence | Balance | Composition |
PercentileNormalized],
PercentileNormalized | Design],
artifact_format=BIOMV210DirFmt
)
5 changes: 3 additions & 2 deletions q2_types/feature_table/tests/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from q2_types.feature_table import (FeatureTable, Frequency,
RelativeFrequency, PercentileNormalized,
Composition, Balance,
PresenceAbsence, BIOMV210DirFmt)
PresenceAbsence, BIOMV210DirFmt, Design)
from qiime2.plugin.testing import TestPluginBase


Expand Down Expand Up @@ -39,7 +39,8 @@ def test_balance_semantic_type_registration(self):
def test_feature_table_semantic_type_to_v210_format_registration(self):
self.assertSemanticTypeRegisteredToFormat(
FeatureTable[Frequency | RelativeFrequency | PresenceAbsence |
Composition | Balance | PercentileNormalized],
Composition | Balance | PercentileNormalized |
Design],
BIOMV210DirFmt)


Expand Down

0 comments on commit eef11a5

Please sign in to comment.