-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
105 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# ---------------------------------------------------------------------------- | ||
# 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. | ||
# ---------------------------------------------------------------------------- | ||
|
||
|
||
import itertools | ||
import gzip | ||
|
||
|
||
def read_fastq_seqs(filepath): | ||
# This function is adapted from @jairideout's SO post: | ||
# http://stackoverflow.com/a/39302117/3424666 | ||
fh = gzip.open(filepath, 'rt') | ||
for seq_header, seq, qual_header, qual in itertools.zip_longest(*[fh] * 4): | ||
yield (seq_header.strip(), seq.strip(), qual_header.strip(), | ||
qual.strip()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ---------------------------------------------------------------------------- | ||
# 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 ._objects import _PlotQualView | ||
|
||
__all__ = ['_PlotQualView'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ---------------------------------------------------------------------------- | ||
# 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. | ||
# ---------------------------------------------------------------------------- | ||
|
||
import importlib | ||
|
||
importlib.import_module('._transformers', __name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# ---------------------------------------------------------------------------- | ||
# 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 q2_types.per_sample_sequences import ( | ||
SingleLanePerSampleSingleEndFastqDirFmt, | ||
SingleLanePerSamplePairedEndFastqDirFmt) | ||
|
||
from .. import _PlotQualView | ||
|
||
from ...plugin_setup import plugin | ||
|
||
|
||
# TODO: Remove _PlotQualView once Union works | ||
@plugin.register_transformer | ||
def _30(dirfmt: SingleLanePerSampleSingleEndFastqDirFmt) -> _PlotQualView: | ||
return _PlotQualView(dirfmt, paired=False) | ||
|
||
|
||
@plugin.register_transformer | ||
def _31(dirfmt: SingleLanePerSamplePairedEndFastqDirFmt) -> _PlotQualView: | ||
return _PlotQualView(dirfmt, paired=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# ---------------------------------------------------------------------------- | ||
# 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. | ||
# ---------------------------------------------------------------------------- | ||
|
||
__all__ = ['_PlotQualView'] | ||
|
||
|
||
# TODO: convert to a Union[...] | ||
class _PlotQualView: | ||
""" | ||
A very simple pass-through view which is made up of a single-end or | ||
paired-end directory format with a bool indicating if single or paired. | ||
""" | ||
def __init__(self, directory_format, paired): | ||
self.directory_format = directory_format | ||
self.paired = paired |