Problem when coding a plugin pipeline

Hi,
I am writing a qiime2 plugin for dbbact (dbbact.org). All the methods work, and now I am now trying to incorporate several methods into a pipeline.

The output of the first method in the pipeline is defined as: FeatureData[Differential] (the function returns a pandas.DataFrame). This should be the input to the second method, and indeed it works when running each method through qiime2 in sequence. However, when I try to call the second method from within the pipeline using the output of the first method, I get the following error:

Plugin error from dbbact:

  Parameter 'diff' received Results (name = value)
  ---------------------------------------------------------------------------------------
  diff = <artifact: FeatureData[Differential] uuid: 512314b6-b59b-4cde-a0d4-c9696b17dc3f> as an argument, which is incompatible with parameter type: FeatureData[Differential]"

Here are the relevant parts from the pipeline code:

    diff_func = ctx.get_action('dbbact', 'diff_abundance')
    diff_table = diff_func(table=table, metadata=metadata, field=field, pair_field=pair_field, repseqs=repseqs, statistical_test=statistical_test,
                           transform_function=transform_function, alpha=sig_threshold, permutations=permutations, random_seed=random_seed, fdr_method=fdr_method,
                           val1=val1, val2=val2)
   
   enrich_func = ctx.get_action('dbbact', 'enrichment')
    print(type(diff_table))
    enriched = enrich_func(diff=diff_table, source='dsfdr', method=method, sig_threshold=sig_threshold, attack=attack, maxid=maxid, random_seed=random_seed)
    print('found %d enriched dbbact terms' % len(enriched))

Any idea what is wrong?

1 Like

Hi @pitaman ,
Please see a solution to your problem here:

Good luck!

2 Likes

Hi Nicholas,
thanks a lot for your help! This explains whats going on :slight_smile:
Since the pipeline needs to return a tuple of Result, instead of accessing the specific outputs by name, I used the first item returned from each plugin function (i.e. x,_ = api_function(…)) - similar to the diversity plugin (I didn’t notice the x, = … in the file there), and then I just append it to the results list.

Thanks again
Amnon

2 Likes