ANCOM plugin error from composition

Dear community, I'm trying to run ANCOM plugin from qiime2 but I've found an error that I'm not able to solve. I don't understand the problem, as I've tried the same with other files and it works...

I'm using qiime2-2023.2 (but it also fails with the qiime2-2022.11 version).


(qiime2-2023.2) [email protected]:/media/pgen/Disco_2/GEN00452_RaquelCampos_nematodos/8_Study_Samples_filtered/Phylum_Nematodos/DA$ qiime composition ancom --i-table comp_table_L2.qza --m-metadata-file metadata_samples_final.csv --m-metadata-column Treatment --o-visualization ancom_L2_Treatment.qzv --verbose
Traceback (most recent call last):
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2cli/", line 352, in __call__
    results = action(**arguments)
  File "<decorator-gen-33>", line 2, in ancom
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/", line 443, in _callable_executor_
    ret_val = self._callable(output_dir=temp_dir, **view_args)
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_composition/", line 81, in ancom
    transformed_table = table.apply(
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/pandas/core/", line 9568, in apply
    return op.apply().__finalize__(self, method="apply")
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/pandas/core/", line 754, in apply
    return self.apply_broadcast(self.obj)
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/pandas/core/", line 1013, in apply_broadcast
    result = super().apply_broadcast(target.T)
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/pandas/core/", line 870, in apply_broadcast
    res = self.f(target[col])
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/skbio/stats/", line 465, in clr
    gm = lmat.mean(axis=-1, keepdims=True)
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/numpy/core/", line 168, in _mean
    rcount = _count_reduce_items(arr, axis, keepdims=keepdims, where=where)
  File "/home/pgen/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/numpy/core/", line 76, in _count_reduce_items
    items *= arr.shape[mu.normalize_axis_index(ax, arr.ndim)]
numpy.AxisError: axis -1 is out of bounds for array of dimension 0

Plugin error from composition:

  axis -1 is out of bounds for array of dimension 0

See above for debug info.

Hi @matoro,

Thanks for reaching out! Looking through the traceback you provided, these are the lines that stand out to me:

When the ancom method is attempting to perform the CLR (centered log ratio), the last axis in your table (i.e. axis -1) is of dimension 0. Since you mentioned you are able to run ancom successfully on other files, it seems like this is an issue with this specific table (i.e. your comp_table_L2.qza file).

Have you examined this table to make sure it looks as expected? I can't say for sure without looking at it on my end, but I suspect it's either empty or it may not contain the associated IDs from the metadata file you included, or there may be no IDs that match the Treatment column within your metadata.

Cheers :lizard:

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