Skip to content

Commit

Permalink
Only have import-fastq if the necessary types are present
Browse files Browse the repository at this point in the history
  • Loading branch information
Oddant1 committed Feb 27, 2024
1 parent 2b859f7 commit 56e8c0d
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions q2galaxy/core/drivers/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@
import qiime2.sdk
import qiime2.util

from q2_types.per_sample_sequences import (
CasavaOneEightSingleLanePerSampleDirFmt, SequencesWithQuality,
PairedEndSequencesWithQuality)
from q2_types.sample_data import SampleData
_IMPORT_FASTQ_ = True

try:
from q2_types.per_sample_sequences import (
CasavaOneEightSingleLanePerSampleDirFmt, SequencesWithQuality,
PairedEndSequencesWithQuality)
from q2_types.sample_data import SampleData
except Exception:
_IMPORT_FASTQ_ = False

from q2galaxy.core.drivers.stdio import error_handler, stdio_files

Expand All @@ -33,10 +38,13 @@ def builtin_runner(action_id, inputs):
def _get_tool(action_id):
builtin_map = {
'import': import_data,
'import-fastq': import_fastq_data,
'export': export_data,
'qza_to_tabular': qza_to_tabular
}

if _IMPORT_FASTQ_:
builtin_map['import-fastq'] = import_fastq_data

try:
return builtin_map[action_id]
except KeyError:
Expand Down

0 comments on commit 56e8c0d

Please sign in to comment.