Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: adds JoinedSequencesWithQuality #160

Merged
merged 1 commit into from
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions q2_types/per_sample_sequences/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
PairedEndFastqManifestPhred64,
QIIME1DemuxFormat, QIIME1DemuxDirFmt)
from ._type import (Sequences, SequencesWithQuality,
PairedEndSequencesWithQuality)
PairedEndSequencesWithQuality,
JoinedSequencesWithQuality)

__all__ = ['CasavaOneEightSingleLanePerSampleDirFmt',
'CasavaOneEightLanelessPerSampleDirFmt',
Expand All @@ -29,8 +30,9 @@
'SingleLanePerSampleSingleEndFastqDirFmt',
'SingleLanePerSamplePairedEndFastqDirFmt', 'Sequences',
'SequencesWithQuality', 'PairedEndSequencesWithQuality',
'SingleEndFastqManifestPhred33', 'SingleEndFastqManifestPhred64',
'PairedEndFastqManifestPhred33', 'PairedEndFastqManifestPhred64',
'QIIME1DemuxFormat', 'QIIME1DemuxDirFmt']
'JoinedSequencesWithQuality', 'SingleEndFastqManifestPhred33',
'SingleEndFastqManifestPhred64', 'PairedEndFastqManifestPhred33',
'PairedEndFastqManifestPhred64', 'QIIME1DemuxFormat',
'QIIME1DemuxDirFmt']

importlib.import_module('q2_types.per_sample_sequences._transformer')
9 changes: 8 additions & 1 deletion q2_types/per_sample_sequences/_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
'SequencesWithQuality', variant_of=SampleData.field['type'])
PairedEndSequencesWithQuality = SemanticType(
'PairedEndSequencesWithQuality', variant_of=SampleData.field['type'])
JoinedSequencesWithQuality = SemanticType(
'JoinedSequencesWithQuality', variant_of=SampleData.field['type'])

plugin.register_semantic_types(Sequences, SequencesWithQuality,
PairedEndSequencesWithQuality)
PairedEndSequencesWithQuality,
JoinedSequencesWithQuality)

plugin.register_semantic_type_to_format(
SampleData[Sequences],
Expand All @@ -31,6 +34,10 @@
SampleData[SequencesWithQuality],
artifact_format=SingleLanePerSampleSingleEndFastqDirFmt
)
plugin.register_semantic_type_to_format(
SampleData[JoinedSequencesWithQuality],
artifact_format=SingleLanePerSampleSingleEndFastqDirFmt
)
plugin.register_semantic_type_to_format(
SampleData[PairedEndSequencesWithQuality],
artifact_format=SingleLanePerSamplePairedEndFastqDirFmt
Expand Down
12 changes: 11 additions & 1 deletion q2_types/per_sample_sequences/tests/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from q2_types.sample_data import SampleData
from q2_types.per_sample_sequences import (
Sequences, SequencesWithQuality, PairedEndSequencesWithQuality,
QIIME1DemuxDirFmt, SingleLanePerSampleSingleEndFastqDirFmt,
JoinedSequencesWithQuality, QIIME1DemuxDirFmt,
SingleLanePerSampleSingleEndFastqDirFmt,
SingleLanePerSamplePairedEndFastqDirFmt
)
from qiime2.plugin.testing import TestPluginBase
Expand All @@ -29,6 +30,9 @@ def test_sequences_with_quality_semantic_type_registration(self):
def test_paired_end_sequences_with_qual_semantic_type_registration(self):
self.assertRegisteredSemanticType(PairedEndSequencesWithQuality)

def test_joined_sequences_with_qual_semantic_type_registration(self):
self.assertRegisteredSemanticType(JoinedSequencesWithQuality)

def test_sequences_semantic_type_to_format_registration(self):
self.assertSemanticTypeRegisteredToFormat(
SampleData[Sequences],
Expand All @@ -47,6 +51,12 @@ def test_paired_end_sequences_semantic_type_to_format_registration(self):
SingleLanePerSamplePairedEndFastqDirFmt
)

def test_joined_sequences_with_quality_semantic_type_to_format_reg(self):
self.assertSemanticTypeRegisteredToFormat(
SampleData[JoinedSequencesWithQuality],
SingleLanePerSampleSingleEndFastqDirFmt
)


if __name__ == '__main__':
unittest.main()