Hello,
I'm a new qiime user trying to make and view a taxonomy barplot within the python API in a jupyter notebook. I've imported FeatureTable[Frequency] and featureData[Taxonomy] objects and created a barplot with them, all without errors. I am trying to export the barplot object to a .qzv file, but when I try to save, I get an error message AttributeError: 'Results' object has no attribute 'save'
.
I was following along with this similar issue.
import qiime2
import pandas as pd
from qiime2 import Artifact
from qiime2 import Visualization
from qiime2.plugins import feature_table as ft_plugin
from qiime2.plugins.taxa.visualizers import barplot
# importing the frequency table
table_artifact = qiime2.Artifact.import_data('FeatureTable[Frequency]', table_df)
# importing taxonomy artifact
tax_artifact = qiime2.Artifact.import_data('FeatureData[Taxonomy]', tax_test)
# make barplot
barplot_output = barplot(table = table_artifact, taxonomy = tax_artifact)
barplot_output.save('barplot.qzv')
I'm not able to view the barplot from the command barplot(table = table_artifact, taxonomy = tax_artifact)
, but see a uuid displayed and assume I'm doing something right. I suspect the failure to visualize is not a qiime issue, so I wanted to try exporting to a qzv.
I am running version 2024.5.0.dev0+1.g6306962 of qiime2, installed via conda (24.3.0) and activated with a jupyter notebook (notebook v. 6.5.5). Running Python 3.8.19 on Mac OS Sonoma 14.3.
Please let me know and I can share something reproducible or clarify anything.
Thanks!
Scott