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

IMP: Add transformer from slpssefdf to Casava #226

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
8 changes: 7 additions & 1 deletion q2_types/per_sample_sequences/_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ def _11(dirfmt: CasavaOneEightLanelessPerSampleDirFmt) \
dirfmt, SingleLanePerSamplePairedEndFastqDirFmt, parse_lane=False)


@plugin.register_transformer
def _12(dirfmt: SingleLanePerSampleSingleEndFastqDirFmt) \
-> CasavaOneEightSingleLanePerSampleDirFmt:
return CasavaOneEightSingleLanePerSampleDirFmt(str(dirfmt), mode='r')
Oddant1 marked this conversation as resolved.
Show resolved Hide resolved


@plugin.register_transformer
def _5(dirfmt: SingleLanePerSamplePairedEndFastqDirFmt) \
-> SingleLanePerSampleSingleEndFastqDirFmt:
Expand Down Expand Up @@ -351,7 +357,7 @@ def _9(fmt: PairedEndFastqManifestPhred64) \


@plugin.register_transformer
def _12(dirfmt: SingleLanePerSampleSingleEndFastqDirFmt) \
def _27(dirfmt: SingleLanePerSampleSingleEndFastqDirFmt) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DBC: Why not keep this as _12, and name the new one _27? Just so you know, with transformers the names of the functions don't matter, we just took the strategy of naming them _number, but it can be anything

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, probably just because I saw _10, _11 and was bothered at the idea of the next thing being _27 but I guess the rest isn't in numerical order anyway 😆

-> QIIME1DemuxDirFmt:
with dirfmt.manifest.view(FastqManifestFormat).open() as fh:
input_manifest = _parse_and_validate_manifest(fh, single_end=True,
Expand Down
6 changes: 3 additions & 3 deletions q2_types/per_sample_sequences/tests/test_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ def test_casava_one_eight_single_lane_per_sample_dirfmt_to_slpssefdf(self):
for act, exp in zip(obs, input):
self.assertEqual(act, exp)

def test_casava_one_eight_single_lane_per_sample_dirfmt_to_slpspefdf(self):
def test_slpssefdf_to_casava_one_eight_single_lane_per_sample_dirfmt(self):
filenames = ('Human-Kneecap_S1_L001_R1_001.fastq.gz',)
input, obs = self.transform_format(
CasavaOneEightSingleLanePerSampleDirFmt,
SingleLanePerSamplePairedEndFastqDirFmt, filenames=filenames
SingleLanePerSampleSingleEndFastqDirFmt,
CasavaOneEightSingleLanePerSampleDirFmt, filenames=filenames
Oddant1 marked this conversation as resolved.
Show resolved Hide resolved
)

input = skbio.io.read(
Expand Down