This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
This QIIME 2 plugin wraps Emperor and supports interactive visualization of ordination plots.
- version:
2024.10.0
- website: http://
biocore .github .io /emperor /build /html /index .html - user support:
- Please post to the QIIME 2 forum for help with this plugin: https://
forum .qiime2 .org - citations:
- Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Actions¶
Name | Type | Short Description |
---|---|---|
plot | visualizer | Visualize and Interact with Principal Coordinates Analysis Plots |
procrustes-plot | visualizer | Visualize and Interact with a procrustes plot |
biplot | visualizer | Visualize and Interact with Principal Coordinates Analysis Biplot |
emperor plot¶
Generates an interactive ordination plot where the user can visually integrate sample metadata.
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- pcoa:
PCoAResults
The principal coordinates matrix to be plotted.[required]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- ignore_pcoa_features:
Bool
Biplot arrows cannot be visualized using this method. If you want to visualize biplot arrows use the
biplot
method. Enabling this setting will ignore any PCoA features that are present, otherwise, if PCoA features are detected an error will be raised.[default:False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
emperor_plot¶
wget -O 'pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
qiime emperor plot \
--i-pcoa pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn = 'pcoa-result.qza'
request.urlretrieve(url, fn)
pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor plot
tool: - Set "pcoa" to
#: pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/pcoa-result.qza'
fn <- 'pcoa-result.qza'
request$urlretrieve(url, fn)
pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$plot(
pcoa=pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import plot
plot(use)
emperor procrustes-plot¶
Plot two procrustes-fitted matrices
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- reference_pcoa:
PCoAResults
The reference ordination matrix to be plotted.[required]
- other_pcoa:
PCoAResults
The "other" ordination matrix to be plotted (the one that was fitted to the reference).[required]
- m2_stats:
ProcrustesStatistics
The M^2 value of the procrustes analysis & its associated p value.[optional]
Parameters¶
- metadata:
Metadata
The sample metadata.[required]
- custom_axes:
List
[
Str
]
Numeric sample metadata columns that should be included as axes in the Emperor plot.[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]
Outputs¶
- visualization:
Visualization
<no description>[required]
Examples¶
procrustes_plot¶
wget -O 'bc-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
wget -O 'unw-pcoa-result.qza' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
wget -O 'sample-metadata.tsv' \
'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
qiime emperor procrustes-plot \
--i-reference-pcoa bc-pcoa-result.qza \
--i-other-pcoa unw-pcoa-result.qza \
--m-metadata-file sample-metadata.tsv \
--o-visualization plot.qzv
from qiime2 import Artifact
from qiime2 import Metadata
from urllib import request
import qiime2.plugins.emperor.actions as emperor_actions
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn = 'bc-pcoa-result.qza'
request.urlretrieve(url, fn)
bc_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn = 'unw-pcoa-result.qza'
request.urlretrieve(url, fn)
unw_pcoa_result = Artifact.load(fn)
url = 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn = 'sample-metadata.tsv'
request.urlretrieve(url, fn)
sample_metadata_md = Metadata.load(fn)
plot_viz, = emperor_actions.procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
bc-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /bc -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
unw-pcoa-result.qza
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /unw -pcoa -result .qza - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
Upload Data
tool: - On the first tab (Regular), press the
Paste/Fetch
data button at the bottom.- Set "Name" (first text-field) to:
sample-metadata.tsv
- In the larger text-area, copy-and-paste: https://
amplicon -docs .qiime2 .org /en /latest /data /examples /emperor /procrustes -plot /1 /sample -metadata .tsv - ("Type", "Genome", and "Settings" can be ignored)
- Set "Name" (first text-field) to:
- Press the
Start
button at the bottom.
- On the first tab (Regular), press the
- Using the
qiime2 emperor procrustes-plot
tool: - Set "reference_pcoa" to
#: bc-pcoa-result.qza
- Set "other_pcoa" to
#: unw-pcoa-result.qza
- For "metadata":
- Perform the following steps.
- Leave as
Metadata from TSV
- Set "Metadata Source" to
sample-metadata.tsv
- Leave as
- Perform the following steps.
- Press the
Execute
button.
- Set "reference_pcoa" to
- Once completed, for the new entry in your history, use the
Edit
button to set the name as follows: - (Renaming is optional, but it will make any subsequent steps easier to complete.)
History Name "Name" to set (be sure to press [Save]) #: qiime2 emperor procrustes-plot [...] : visualization.qzv
plot.qzv
library(reticulate)
Artifact <- import("qiime2")$Artifact
Metadata <- import("qiime2")$Metadata
emperor_actions <- import("qiime2.plugins.emperor.actions")
request <- import("urllib")$request
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/bc-pcoa-result.qza'
fn <- 'bc-pcoa-result.qza'
request$urlretrieve(url, fn)
bc_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/unw-pcoa-result.qza'
fn <- 'unw-pcoa-result.qza'
request$urlretrieve(url, fn)
unw_pcoa_result <- Artifact$load(fn)
url <- 'https://amplicon-docs.qiime2.org/en/latest/data/examples/emperor/procrustes-plot/1/sample-metadata.tsv'
fn <- 'sample-metadata.tsv'
request$urlretrieve(url, fn)
sample_metadata_md <- Metadata$load(fn)
action_results <- emperor_actions$procrustes_plot(
reference_pcoa=bc_pcoa_result,
other_pcoa=unw_pcoa_result,
metadata=sample_metadata_md,
)
plot_viz <- action_results$visualization
from q2_emperor._examples import procrustes_plot
procrustes_plot(use)
emperor biplot¶
Generates an interactive ordination biplot where the user can visually integrate sample and feature metadata. Vectors representing the n most important features are then plotted in the emperor visualization (5 largest, by default).
Citations¶
Vázquez-Baeza et al., 2013; Vázquez-Baeza et al., 2017
Inputs¶
- biplot:
PCoAResults
%
Properties
('biplot')
The principal coordinates matrix to be plotted.[required]
Parameters¶
- sample_metadata:
Metadata
The sample metadata[required]
- feature_metadata:
Metadata
The feature metadata (useful to manipulate the arrows in the plot).[optional]
- ignore_missing_samples:
Bool
This will suppress the error raised when the coordinates matrix contains samples that are not present in the metadata. Samples without metadata are included by setting all metadata values to: "This sample has no metadata". This flag is only applied if at least one sample is present in both the coordinates matrix and the metadata.[default:
False
]- invert:
Bool
If specified, the point and arrow coordinates will be swapped.[default:
False
]- number_of_features:
Int
%
Range
(1, None)
The number of most important features (arrows) to display in the ordination. “Importance” is calculated for each feature based on the vector’s magnitude (euclidean distance from origin).[default:
5
]
Outputs¶
- visualization:
Visualization
<no description>[required]
- Links
- Documentation
- Source Code
- Stars
- 1
- Last Commit
- 018b885
- Available Distros
- 2024.10
- 2024.10/amplicon
- 2024.10/metagenome
- 2024.5
- 2024.5/amplicon
- 2024.5/metagenome
- 2024.2
- 2024.2/amplicon
- 2023.9
- 2023.9/amplicon
- 2023.7
- 2023.7/core