Biplot with shortened taxa label?

Hi, I've created a biplot for my data with taxonomic labels as opposed to feature IDs (emperor plot image attached).

However, as you can see, the labels obscure a large portion if the plot. Is it possible to collapse labels to the lowest level? For instance this can be done for da-barplots using --p-level-delimiter, but as far as I can see this isn't an option when producing the biplot .qzv.

I'm using qiime version v.2023.7.0
Commands:

qiime taxa collapse
--i-table sex_adult_24000_rarefied_table.qza
--i-taxonomy taxonomy-Combined_16S-SILVA.qza
--p-level 6
--o-collapsed-table sex_adult_collapsed_24000_rarefied_table.qza

qiime feature-table relative-frequency
--i-table sex_adult_collapsed_24000_rarefied_table.qza
--o-relative-frequency-table sex_adult_relative_collapsed_24000_rarefied_table.qza

qiime diversity pcoa-biplot
--i-pcoa sex-adult-bray-curtis-pcoa-results.qza
--i-features sex_adult_relative_collapsed_24000_rarefied_table.qza
--o-biplot sex_adult__bray-curtis_biplot.qza

qiime emperor biplot
--i-biplot sex_adult__bray-curtis_biplot.qza
--m-sample-metadata-file "16S_Metadata10_sex_adult.txt"
--o-visualization sex_adult__bray-curtis_biplot.qzv

Any help is much appreciated!

Hi @DrL,

I'd suggest the following:

  1. Read through the tutorial on qiime rescript edit-taxonomy .... This should give you a few ideas on how you can edit / truncate your taxonomy to make them more amenable to figure generation.

  2. Use this modified taxonomy file as the input to the qiime taxa collapse ... command. Keep in mind you may need to alter --p-level to match the length of your new taxonomy strings.

  3. Follow the rest of your commands as you already have them.

Let us know if this works! :slight_smile:

4 Likes

Hi @SoilRotifer,

Thank you very much for your response - I was in the process of trying out your suggestion, however something seems to have gone wrong with the rescript installation - my environment is eternally caching:

QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.

Traceback (most recent call last):
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/util.py", line 266, in get_plugin_manager
return qiime2.sdk.PluginManager.reuse_existing()
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 58, in reuse_existing
raise UninitializedPluginManagerError
qiime2.sdk.plugin_manager.UninitializedPluginManagerError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/bin/qiime", line 11, in
sys.exit(qiime())
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/click/core.py", line 1077, in main
with self.make_context(prog_name, args, **extra) as ctx:
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/click/core.py", line 943, in make_context
self.parse_args(ctx, args)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/click/command.py", line 43, in parse_args
return super().parse_args(ctx, args)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/click/core.py", line 1641, in parse_args
echo(ctx.get_help(), color=ctx.color)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/click/core.py", line 704, in get_help
return self.command.get_help(self)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/click/core.py", line 1325, in get_help
self.format_help(ctx, formatter)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/click/core.py", line 1358, in format_help
self.format_options(ctx, formatter)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/click/command.py", line 157, in format_options
for subcommand in self.list_commands(ctx):
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/commands.py", line 92, in list_commands
plugins = sorted(self._plugin_lookup)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/commands.py", line 76, in _plugin_lookup
import q2cli.core.cache
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/core/cache.py", line 285, in
CACHE = DeploymentCache()
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/core/cache.py", line 61, in init
self._state = self._get_cached_state(refresh=refresh)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/core/cache.py", line 107, in _get_cached_state
self._cache_current_state(current_requirements)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/core/cache.py", line 205, in _cache_current_state
state = self._get_current_state()
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/core/cache.py", line 253, in _get_current_state
plugin_manager = q2cli.util.get_plugin_manager()
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/q2cli/util.py", line 278, in get_plugin_manager
return qiime2.sdk.PluginManager()
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 67, in new
self._init(add_plugins=add_plugins)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py", line 105, in _init
plugin = entry_point.load()
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/pkg_resources/init.py", line 2518, in load
return self.resolve()
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/pkg_resources/init.py", line 2524, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/shared/team/conda/danielrlewis.streptomyces/qiime2/lib/python3.8/site-packages/rescript/plugin_setup.py", line 11, in
from q2_types.genome_data import GenomeData, Loci, Proteins
ModuleNotFoundError: No module named 'q2_types.genome_data'

I ran these commands to install:

conda install -c conda-forge -c bioconda -c qiime2
-c https://packages.qiime2.org/qiime2/2023.7/shotgun/released/
-c defaults xmltodict 'q2-types-genomics>2023.5' ncbi-datasets-pylib

pip install git+https://github.com/bokulich-lab/RESCRIPt.git

qiime dev refresh-cache

I'm using qiime v.2023.7 and conda v.23.1.0

Do you have any idea A) what I did wrong on the initial install? B) How I can get the qiime environment functioning again?

Best wishes,
Dan

I'd simply install the latest version of QIIME 2 (2024.2) as it comes with RESCRIPt installed.

Otherwise try these instructions for 2023.7.

2 Likes

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