Skip to content

Commit

Permalink
ENH: add SampleData[JoinedSequencesWithQuality] as input for classify…
Browse files Browse the repository at this point in the history
…-kraken2 (#202)

Co-authored-by: Michal Ziemski <[email protected]>
  • Loading branch information
cherman2 and misialq authored Oct 21, 2024
1 parent 428fcae commit 10bb850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion q2_moshpit/kraken2/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from q2_types.per_sample_sequences import (
SequencesWithQuality,
PairedEndSequencesWithQuality,
JoinedSequencesWithQuality,
SingleLanePerSamplePairedEndFastqDirFmt,
SingleLanePerSampleSingleEndFastqDirFmt,
ContigSequencesDirFmt, Contigs,
Expand Down Expand Up @@ -73,7 +74,8 @@ def classify_kraken2(
collate_kraken2_outputs = ctx.get_action("moshpit",
"collate_kraken2_outputs")

if seqs.type <= SampleData[SequencesWithQuality]:
if seqs.type <= SampleData[SequencesWithQuality |
JoinedSequencesWithQuality]:
partition_method = ctx.get_action("demux", "partition_samples_single")
elif seqs.type <= SampleData[PairedEndSequencesWithQuality]:
partition_method = ctx.get_action("demux", "partition_samples_paired")
Expand Down
5 changes: 3 additions & 2 deletions q2_moshpit/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
FeatureTable, Frequency, PresenceAbsence, RelativeFrequency
)
from q2_types.per_sample_sequences import (
SequencesWithQuality, PairedEndSequencesWithQuality, MAGs, Contigs
SequencesWithQuality, PairedEndSequencesWithQuality,
JoinedSequencesWithQuality, MAGs, Contigs
)
from q2_types.sample_data import SampleData
from q2_types.feature_map import FeatureMap, MAGtoContigs
Expand Down Expand Up @@ -166,7 +167,7 @@

T_kraken_in, T_kraken_out_rep, T_kraken_out_hits = TypeMap({
SampleData[SequencesWithQuality |
PairedEndSequencesWithQuality]: (
PairedEndSequencesWithQuality | JoinedSequencesWithQuality]: (
SampleData[Kraken2Reports % Properties('reads')],
SampleData[Kraken2Outputs % Properties('reads')]
),
Expand Down

0 comments on commit 10bb850

Please sign in to comment.