Hello
I tried to read a similar post but it didn’t give me the answer I need about how to convert a results object into an Artifact
Here is my code:
table_2k_qza=filter_samples(table=dada2_table_qza, min_frequency=2000)
I am trying to translate the Parkinson Mouse tutorial into API.
The next code is:
taxa_barplot_qzv=barplot(table_2k_qza, taxonomy=Artifact.load(“taxonomy.qza”), metadata=metadata)
The error I get in the next step is : TypeError: Parameter ‘table’ received Results (name = value)
Can someone help me convert table_2k_qza into Artifact? i am stuck
Typically a command from the Artifact API such as feature_table.actions.filter_samples will return a Results object. If you print the object you should be able to see the identifier of the data contained in the Results. In the case of filter_samples I believe it is filtered_table. Try print(table_2k_qza) to confirm this is the case.
That’s great! It worked!!
but then, I have the same errpr, which I don’t understand why because it is exactly the same error:
Here is the next code I used:
ancom_donor_qzv=ancom(table2k_abund_comp_qza, metadata=metadata.get_column(“donor”))
.filtered_table doesn’t work this time.
and the error : TypeError: Parameter ‘table’ received Results (name = value)
composition_table = <artifact: FeatureTable[Composition] uuid: be2a115a-ba66-4157-802b-5b95fb86a6ef> as an argument, which is incompatible with parameter type: FeatureTable[Composition]
I am sorry if my questions are stupid, I am very grateful for your help.
As @gibsramen mentioned above, all actions in the Artifact API will return Results objects. Every results object is essentially a python namedtuple (8.3. collections — Container datatypes — Python 3.6.15 documentation) - you can access any of the outputs from the action by calling the result.output_name (where output_name is the name of the output you wish to access).