2D PCoA plot error qiime2

Hi everyone,

I wanted to make a 2D PCoA plots similar to the one below. I can't find any other codes than these. So, I used it and it gave me error.

(qiime2-2023.5) hando@Cinderellas-MacBook-Pro AlphaDiversity_FS % qiime tools export --output-dir exported unweighted_unifrac_pcoa_results.qza
make_2d_plots.py -i exported/ordination.txt -m metadata4.tsv -o 2D-plots
Usage: qiime tools export [OPTIONS]

Exporting extracts (and optionally transforms) data stored inside an
Artifact or Visualization. Note that Visualizations cannot be transformed
with --output-format

Options:
--input-path ARTIFACT/VISUALIZATION
Path to file that should be exported [required]
--output-path PATH Path to file or directory where data should be
exported to [required]
--output-format TEXT Format which the data should be exported as. This
option cannot be used with Visualizations
--help Show this message and exit.

                There was a problem with the command:                     

(1/1?) No such option: --output-dir
zsh: command not found: make_2d_plots.py

Hi @Han_Do,
The make_2d_plots.py command you're trying to access is a QIIME 1 command. That won't be installed in your QIIME 2 environment, and isn't supported anymore, so I would recommend not trying to go that route.

If you have any favorite tool for generating 2D scatterplots, you should be able to load the data with that tool and plot it the Axis 1 and Axis 2 data from the file that you exported.

Some options if you don't have a favorite tool for this are Excel or Google Sheets, Altair, or phyloseq.

Note that you can also use Emperor to view 2D plots. You can axis this functionality in the "Axes" tab of your Emperor plot:

EDIT: I realize now that none of those tools produce the circles around the points, which may be what you're most interested in from those plots. phyloseq will get you the closest of all of those (thanks for the suggestion @colinbrislawn!). You can also use QIIME 2's beta-rarefaction command to generate a jack-knifed Emperor plot that illustrates the variance around each point through multiple (default 10) jack-knife iterations. This isn't the same as the ellipse around the points, like in the plot you shared, but similar idea.

Hope this helps!
Greg

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.