Hi everyone,
I am trying to develop my first Qiime2 plugin and I am currently struggling with how to create the plugin given my data types.
In general, all my functions (either methods or visualizers) only take parameters of the following kind: str, int, bool, dict, list, tuple; and they output either a pandas dataframe or List[pd.Dataframe] or generate a plot. Thus, they are mostly primitive and I do not seem to use any of the "standard" semantic types.
Specifically, assume for example, I wish to register the following method:
def bacdive_call(
bacdive_id: str = "",
bacdive_password: str = "",
input_via_file: int = 0,
input_lists: Dict[str, List[str]] = {},
search_by_id: bool = False,
output_dir: str = "./") -> pd.DataFrame:
In my plugin_setup.py
I write the following:
plugin.methods.register_function(
function=q2_test._bacdive_caller.bacdive_call,
inputs={},
parameters={"bacdive_id" : Str,
"bacdive_password" : Str,
"input_via_file" : Int,
"input_lists" : Dict[Str, List[Str]],
"search_by_id" : Bool,
"output_dir" : Str},
outputs=[("resulting_df", pd.DataFrame)],
input_descriptions={},
parameter_descriptions={...},
...
...
As you can see, I have left input
and input_descriptions
empty.
Also, note that I have simply labeled "resulting_df" as a pandas dataframe. Can I do this or does it rather belong to the category Metadata? However, my "resulting_df" (which is a pandas dataframe and my function's output) does not have "standard" column types of being either categorical/numeric. It may contain lists or lists with dictionaries as well as standard numerical and categorical entries...
Here you can see an example of how the "resulting_df" might look like:
So, how do I do the method registration?
Many thanks in advance.