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

Allow multiple artifact commands #69

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 3 additions & 7 deletions qp_qiime2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@
req_params[ename] = ('choice:[%s]' % qp_qiime2_dbs, default)
req_params['qp-hide-param' + ename] = ('string', pname)
else:
ename = element.description
ename = f'{element.description} [{pname}]'

# this is an odd one, first encountered:
# feature-classifier fit-classifier-naive-bayes
if ename == element.NOVALUE:
Expand Down Expand Up @@ -232,12 +233,6 @@
# As of qiime2-2022.2 this filters out:
# filtered_sequences filter_seqs
continue
elif total_inputs > 1:
# As of qiime2-2022.2 this filters out:
# 2
# biplot pcoa_biplot
# visualization mantel
continue

for pname, element in parameters.items():
tqt, predicate = get_qiime2_type_name_and_predicate(element)
Expand Down Expand Up @@ -307,6 +302,7 @@
opt_params[name] = ('string', 'qp-hide-metadata-field')
else:
ename = '%s (%s)' % (element.description, pname)

if element.has_default():
opt_params[ename] = (data_type, default)
# we need to add the actual name of the parameter so we
Expand Down
13 changes: 9 additions & 4 deletions qp_qiime2/qp_qiime2.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@
'expression': []},
'alpha_vector': {
'name': 'SampleData',
'expression': ['AlphaDiversity']},
'expression': ['AlphaDiversity', 'ClassifierPredictions',
'Probabilities']},
'phylogeny': {
'name': 'Phylogeny',
'expression': ['Rooted']},
'FeatureData': {
'name': 'FeatureData',
'expression': ['Taxonomy', 'Sequence']},
'expression': ['Taxonomy', 'Sequence', 'Importance']},
'TaxonomicClassifier': {
'name': 'TaxonomicClassifier',
'expression': []},
Expand Down Expand Up @@ -310,8 +311,12 @@ def call_qiime2(qclient, job_id, parameters, out_dir):
if mkey.view_type is set:
val = {val}
else:
val = qiime2.sdk.util.parse_primitive(
mkey.qiime_type.to_ast(), val)
# if ast['name'] == 'List', we need to make sure to take
# the user give val and make it a list
ast = mkey.qiime_type.to_ast()
if 'name' in ast and ast['name'] == 'List':
val = [val]
val = qiime2.sdk.util.parse_primitive(ast, val)

q2params[key] = val
elif k in ('qp-hide-metadata', 'qp-hide-FeatureData[Taxonomy]'):
Expand Down
Loading