Plugin error from itsxpress: list index out of range

I'm trying to use ITSxpress to extract the ITS1 region from my demultiplexed AVITI sequence data, but running the command keeps failing due to a plugin error: list index out of range. What might be causing this? Looking at previous forum posts, memory issues produce a different error and so do dependency version conflicts. I tried using --verbose as a tag for the commands to get more info (apparently that only works for q2cl) and I tried viewing the debug info but haven't figured out how to reach it.

I'm working in a Kubernetes pod with the Qiime2 2026.4 Quay image that has conda 26.1.1.

## .yaml file commands
command:
        - /bin/sh
        - -c
        - 'cd /biovol && conda install -c bioconda itsxpress && qiime dev refresh-cache && qiime itsxpress trim-pair-output-unmerged --i-per-sample-sequences demux_seqs.qza --p-region ITS1 --p-threads 0 --o-trimmed ITS-trimmed-seqs.qza'

Here are the logs for the pod:

Retrieving notices: done
Channels:
 - bioconda
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
    current version: 26.1.1
    latest version: 26.5.3

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /opt/conda/envs/rachis-qiime2-2026.4/

  added / updated specs:
    - itsxpress


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    biopython-1.86             |  py312h47b2149_0        14.3 MB
    ca-certificates-2026.7.16  |       h06a4308_0         106 KB
    certifi-2026.7.22          |  py312h06a4308_0         135 KB
    itsxpress-2.1.4            |     pyhdfd78af_0         1.0 MB  bioconda
    ------------------------------------------------------------
                                           Total:        15.5 MB

The following NEW packages will be INSTALLED:

  biopython          pkgs/main/linux-64::biopython-1.86-py312h47b2149_0 
  itsxpress          bioconda/noarch::itsxpress-2.1.4-pyhdfd78af_0 

The following packages will be UPDATED:

  ca-certificates    conda-forge/noarch::ca-certificates-2~ --> pkgs/main/linux-64::ca-certificates-2026.7.16-h06a4308_0 
  certifi            conda-forge/noarch::certifi-2026.2.25~ --> pkgs/main/linux-64::certifi-2026.7.22-py312h06a4308_0 


Proceed ([y]/n)? 

                                                      done
Preparing transaction: done                          
Verifying transaction: done                          
Executing transaction: done                          

Channel "defaults" has the following notices:
  [info] -- Tue Jun  9 00:00:00 2026
  PyTorch 2.12 with CUDA support is now available to install with your current channel (Anaconda Main). Learn more: https://anaconda.org/main/pytorch?utm_source=channel_notices

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

               list index out of range

Debug info has been saved to /tmp/qiime2-q2cli-err-ij9rvch9.log

If you use the same dataset as you posted before, I wouldn't be surprised that this is caused by the samples with a low number of reads. I'd suggest to remove samples with <500 or <1000 reads and then rerun ITSxpress. This might fix it.

Hello @kranderson,

Could you add the --verbose flag to the qiime itsxpress trim-pair-output-unmerged command and post the output? This will give us more information about what's going on.

I couldn't get --verbose to work previously, but it wasn't an issue this time. I switched to Qiime2 version 2024.10 because I assumed that was a better version for ITSxpress. Below is the debug info:

ERROR:root:There appears to be an issue reading the input file /tmp/qiime2/root/data/77cadf46-8a9d-4c2d-baef-aa5ebe2ddeb6/data/5A1_126_L001_R1_001.fastq.gz.
Traceback (most recent call last):
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/q2cli/commands.py", line 530, in call
results = self._execute_action(
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/q2cli/commands.py", line 602, in _execute_action
results = action(**arguments)
File "", line 2, in trim_pair_output_unmerged
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/qiime2/sdk/action.py", line 299, in bound_callable
outputs = self.callable_executor(
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/qiime2/sdk/action.py", line 570, in callable_executor
output_views = self._callable(**view_args)
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/itsxpress/q2_itsxpress.py", line 151, in trim_pair_output_unmerged
results = main(per_sample_sequences=per_sample_sequences,
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/itsxpress/q2_itsxpress.py", line 205, in main
sobj = _set_fastqs_and_check(
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/itsxpress/q2_itsxpress.py", line 62, in _set_fastqs_and_check
itsxpress._check_fastqs(fastq=fastq, fastq2=fastq2)
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/itsxpress/main.py", line 215, in _check_fastqs
if core(fastq):
File "/opt/conda/envs/qiime2-amplicon-2024.10/lib/python3.10/site-packages/itsxpress/main.py", line 210, in core
return test_pair_names_str(reclist[0].id, reclist[1].id)
IndexError: list index out of range

Plugin error from itsxpress:

list index out of range

See above for debug info.

Thank you for your time, Colin!

Is there a way for me to do this in Qiime, or can I only do this manually by removing those samples from my manifest and then re-importing? The reason I ask is because all of the filtering options I've seen need a table artifact, and you don't get a table until you process the samples in some way (de-noise, trim, cluster, etc.) which is done after using ITSxpress.

Hello @kranderson,

Indeed it looks like one of your sequencing files did not have at least two records. The developer addressed this issue in recent changes that you can see in this diff.

Hello @kranderson,

In response to your question about re-importing, no, you do not need to do that. I think that demux filter-samples is what you're looking for.

you could:

#summarise your read artifact
qiime demux summarize \
  --i-data your_reads.qza \
  --o-visualization your_reads.qzv


#export to a TSV, this contains the counts
qiime tools export \
--input-path your_reads.qzv \
--output-path demux_summary_export

#create a .tsv file containing all sampleIDs that have >=500 reads. You can change the number as you like
MINREADS=500

awk -v n="$MINREADS" 'NR>1 && $2 >= n {print $1}' demux_summary_export/per-sample-fastq-counts.tsv keep_samples_get500.tsv

(echo '#SampleID'; cat keep_samples_get500.tsv) > keep_samples_full.tsv

#filter the samples, containing only the samples present in the keep samples files
qiime demux filter-samples \
--i-demux your_reads.qza \
--m-metadata-file keep_samples_full.tsv \
--o-filtered-demux your_readS_filtered.qza


#verify
qiime demux summarize \
  --i-data your_readS_filtered.qza \
  --o-visualization your_readS_filtered.qzv


Thank you @colinvwood and @Rob_DNA!

As for the code block, I think this is a simpler way of going about it. :slight_smile: But of course, please let me know if this is not doing what I think it's doing.

## Export visualization to a TSV
qiime tools export \
--input-path demux_seqs.qzv \
--output-path demux_summary_export

## Filter to keep only samples w/ >500 reads
qiime demux filter-samples \
  --i-demux demux_seqs.qza \
  --m-metadata-file demux_summary_export/per-sample-fastq-counts.tsv \
  --p-where 'CAST([forward sequence count] AS INT) > 500' \
  --p-remove-empty \
  --o-filtered-demux filt_seqs.qza \
  --verbose

I've never used this approach so I cannot verify if it works, but would be great as it removes the awk steps :wink:

Thanks again y'all! ITSxpress performed better than cutadapt. :slight_smile: There are more retained features and samples after the various filtering steps (DADA2, clustering, and decontamination). Well worth the little bit of debugging.