Emperor plot add_vectors functionality lost from Qiime1

Hi! I was wondering if Qiime 2 has anything similar to the “add_vectors” feature from Qiime1’s make_emperor.py? I have paired samples and I would like to add lines to connect these samples. I was looking through the help on it, but don’t see the feature anymore. It’d be great if this feature could be added to Qiime2!

-bash-4.1$ qiime emperor plot --help
Usage: qiime emperor plot [OPTIONS]

Generates an interactive ordination plot where the user can visually
integrate sample metadata.

–i-pcoa ARTIFACT PATH PCoAResults
The principal coordinates matrix to be
plotted. [required]
–m-metadata-file MULTIPLE PATH
Metadata file or artifact viewable as
metadata. This option may be supplied
multiple times to merge metadata. The sample
metadata. [required]
–p-custom-axes MULTIPLE TEXT Numeric sample metadata columns that should
be included as axes in the Emperor plot.
–o-visualization VISUALIZATION PATH
[required if not passing --output-dir]
–output-dir DIRECTORY Output unspecified results to a directory
–cmd-config PATH Use config file for command options
–verbose Display verbose output to stdout and/or
stderr during execution of this action.
[default: False]
–quiet Silence output if execution is successful
(silence is golden). [default: False]
–citations Show citations and exit.
–help Show this message and exit.


Hi @drish_k,

Not sure exactly how this was in qiime1, but check out the last bit at the end of this section from the moving picture tutorial.

qiime emperor plot \
  --i-pcoa core-metrics-results/unweighted_unifrac_pcoa_results.qza \
  --m-metadata-file sample-metadata.tsv \
  --p-custom-axes DaysSinceExperimentStart \
  --o-visualization core-metrics-results/unweighted-unifrac-emperor-DaysSinceExperimentStart.qzv

Then, in the Emperor plot go to the animation tab, set Gradient to Day, and trajectory as BodySite. Press play. Is this sort of what you were looking for?

1 Like

Not quite... that feature was not to visualize time series data in any way, it was simply to link paired samples by a metadata field. For ex. paired patients with the same "patientID" but different "condition". I've attached a snippet of the options from the original make_emperor script (refer to the last argument in the attachment).

Hi @drish_k,
Having looked through the snippet you attached I think all the options in there are in fact still available in qiime2 (plus some more), I guess it's just a matter of figuring out what it is exactly you're trying to show.
"Paired samples" in a way is just a subcategory of "time-series", where you are just using 2 paired data points instead of more. This doesn't have to be time of course either, it can be 'condition' in your case like 'treatment' and 'no treatment'. The only catch with the current set up is though since we are using the animation action we do need to account for the order in which the samples will initially be connected.
So, for example, to get the below figure I set up my animation tab like so:
Gradient = 'condition' where my metadata columns were either a 0 (condition A) or 1 (condition B). These will have to be numerical.
Trajectory = subjectID, where the each subject appears once for each condition. These can be characters/numerical. But the same subjectID has to be identical in order for them to be paired.

So in the figure, each patient is represented twice, once for each condition and they are linked by a vector.
If this is still not what you are looking for then could you provide us with an example figure of what you are exactly looking for and hopefully we can figure out how to get you there.

1 Like

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