-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW: Add tool specifically for importing fastq data both paired and u…
…npaired (#49)
- Loading branch information
Showing
4 changed files
with
154 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,4 @@ clean: distclean | |
rm -rf ./rendered/tests/suite_*; \ | ||
rm -rf ./rendered/tools/suite_* | ||
|
||
distclean: ; | ||
|
||
distclean: ; |
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,59 @@ | ||
# ---------------------------------------------------------------------------- | ||
# Copyright (c) 2018-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 qiime2.sdk import PluginManager | ||
|
||
from q2galaxy.core.util import XMLNode | ||
from q2galaxy.core.templaters.common import (make_builtin_version, | ||
make_tool_name_from_id, | ||
make_requirements, | ||
make_citations) | ||
|
||
|
||
def make_builtin_import_fastq(meta, tool_id): | ||
pm = PluginManager() | ||
|
||
plugins = set() | ||
for record in sorted(pm.get_semantic_types().values(), | ||
key=lambda x: str(x.semantic_type)): | ||
plugins.add(record.plugin) | ||
|
||
tool = XMLNode('tool', id=tool_id, name=make_tool_name_from_id(tool_id), | ||
version=make_builtin_version(plugins)) | ||
tool.append(_make_input()) | ||
tool.append(_make_output()) | ||
tool.append( | ||
XMLNode('command', "q2galaxy run tools import-fastq '$inputs'")) | ||
tool.append(XMLNode('description', | ||
'Import fastq data into a QIIME 2 artifact')) | ||
tool.append(_make_config()) | ||
tool.append(make_citations()) | ||
tool.append(make_requirements(meta, *[p.project_name for p in plugins])) | ||
return tool | ||
|
||
|
||
def _make_config(): | ||
configfiles = XMLNode('configfiles') | ||
configfiles.append(XMLNode( | ||
'inputs', name='inputs', data_style='staging_path_and_source_path')) | ||
return configfiles | ||
|
||
|
||
def _make_input(): | ||
inputs = XMLNode('inputs') | ||
inputs.append(XMLNode( | ||
'param', name='import', type='data_collection', | ||
collection_type='list, list:paired')) | ||
return inputs | ||
|
||
|
||
def _make_output(): | ||
outputs = XMLNode('outputs') | ||
outputs.append(XMLNode( | ||
'data', name='imported-data', format='qza', | ||
from_work_dir='imported_data.qza')) | ||
return outputs |