Showing no output type

plugin-development
pending-development

(Kyle Weber) #1

In the plugin that I am developing for Qiime2, I have run into a issue when making the input type and output type the same core q2_type.
When you run the plugin qiime [plugin] [command], it shows the required inputs and parameters and not the output.

Capture

It seems like if you have the input and output the same type, it repeats the input requirement and ignores the set output.

I have the input type as:
inputs={'per_sample_sequences':SampleData[PairedEndSequencesWithQuality]}
and the output as:
outputs= [('per_sample_sequences':SampleData[JoinedSequencesWithQuality])]

Here is the whole plugin function:

plugin.methods.register_function(
    function=test,
    inputs={'per_sample_sequences': SampleData[PairedEndSequencesWithQuality]},
    parameters={'region': Str %Choices('test1','test2'),
                'taxa': Str %Choices('test1','test2'),
                'threads': Int},
    outputs=[('per_sample_sequences', SampleData[JoinedSequencesWithQuality)],
    input_descriptions={'per_sample_sequences': '......'},
    parameter_descriptions={
        'region': ('The regions.'),
        'taxa': ('The selected taxonomic group.'),
        'threads': ('The number of processor threads to use.')
    },
    output_descriptions={'per_sample_sequences': '.......'},
    name='Test',
    description='Test is.....'
)

when test() is

def test(per_sample_sequences: SingleLanePerSamplePairedEndFastqDirFmt,
         region: str,
         taxa: str,
         threads: int)-> SingleLanePerSampleSingleEndFastqDirFmt:

         results = SingleLanePerSampleSingleEndFastqDirFmt()
         return results

(Matthew Ryan Dillon) #2

(Matthew Ryan Dillon) #3

Hey there @kweber!

Close! The problem isn’t cause by the type, but rather the name — you are naming the input per_sample_sequences, and also using that name for the output — that is the source of the error (and specifically, this is an issue limited to q2cli). Rename the output to something else (not sure what you plugin does, but an example from feature-table rarefy is table for the input and rarefied-table for the output) and you should be good to go!

Please see this open issue for more detail.

Hope that helps! :qiime2: :t_rex:

PS - can’t wait to learn more about your plugin! Feel free to share it here if you want someone to take a look at it! :eyes:


(Matthew Ryan Dillon) #4

(Kyle Weber) #5

Thank you very much! I understand the issue I had now.

I changed the name and it works fine now.

Sorry for the late reply.