Issue in Analysis of Community

Hey friends,

I got stuck in the ANCOM step. I used the different columns of metadata but I failed. I received the following error.

Plugin error from composition:

ids_to_keep must contain at least one ID.

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


With verbose I run

Traceback (most recent call last):
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/commands.py”, line 311, in call
results = action(**arguments)
File “</home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/decorator.py:decorator-gen-466>”, line 2, in ancom
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 231, in bound_callable
output_types, provenance)
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 427, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_composition/_ancom.py”, line 46, in ancom
metadata = metadata.filter_ids(table.index)
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/metadata/metadata.py”, line 1104, in filter_ids
ids_to_keep)
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/metadata/metadata.py”, line 189, in _filter_ids_helper
raise ValueError("ids_to_keep must contain at least one ID.")
ValueError: ids_to_keep must contain at least one ID.

Plugin error from composition:

ids_to_keep must contain at least one ID.

See above for debug info.


I also made an extra column as a treatment. The same result was shown.


I checked the table. Something went wrong! I got this error

(1/1) Invalid value for “–i-table”: Expected an artifact of at least type
FeatureTable[Frequency | RelativeFrequency | PresenceAbsence]. An artifact
of type FeatureTable[Composition] was provided.


Beside the issue I mentioned above, I have some questions in this regard.

I would like to know the filtering step is necessary?

qiime feature-table filter-samples
–i-table
–m-metadata-file
–p-where
–o-filtered-table

I saw in one of the discussions, Matthew Ryan Dillon replied to Yogesh_Gupta " This error means you don’t have multiple values in the Tissue column. This makes sense since, in an earlier step, you filtered your table to only include Tissue=' Soil' samples."
So would it be the case? Should I avoid this step or should it be involved?

My aim is to compare the treated and untreated samples each other. There are four untreated and four treated samples, altogether eight samples.
Finally, how could it be solved?

Hi!
Filtration step is optional. In the tutorial, they decided to compare only “Gut” samples, so they filtered table.
It would be better if you will provide your metadata file and commands you are running.

1 Like

Hi @timanix,

This time it processed the analyzing in the absence of the filtering step. It sent me an error which the IDs are not present in the current metadata. I generated another metadata by the new IDs it demonstrated. After running the command with the new metadata it gave a different error:

Plugin error from composition:

All values in grouping are unique. This method cannot operate on a grouping vector with only unique values (e.g., there are no ‘within’ variance because each group of samples contains only a single sample).

See above for debug info.

Now, I have four untreated and eight treated samples. It is more than two samples! each treatment is different time points.


This is with verbose with the command:

qiime composition ancom --i-table comp-table.qza --m-metadata-file NewmetadataforANCOM.tsv --m-metadata-column samples --o-visualization ancom-Subject.qzv --verbose

Traceback (most recent call last):
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2cli/commands.py”, line 311, in call
results = action(**arguments)
File “</home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/decorator.py:decorator-gen-466>”, line 2, in ancom
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 231, in bound_callable
output_types, provenance)
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/qiime2/sdk/action.py”, line 427, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/q2_composition/_ancom.py”, line 56, in ancom
significance_test=f_oneway)
File “/home/mpi/miniconda3/envs/qiime2-2019.4/lib/python3.6/site-packages/skbio/stats/composition.py”, line 1081, in ancom
"All values in grouping are unique. This method cannot "
ValueError: All values in grouping are unique. This method cannot operate on a grouping vector with only unique values (e.g., there are no ‘within’ variance because each group of samples contains only a single sample).

It is why I asked for your metadata file.
All values are unique and plugin is unable to calculate differences between your samples, because all values are unique. If you will provide metadata file it will be easier to correct the error.

Oh sorry I forgot it! @timanix

This one is old metadata!
metadata.tsv (1.2 KB)

This one is the new!
NewmetadataforANCOM.tsv (111 Bytes)

I knew it will be this metadata!
I already wrote to you earlier that your metadata organised in a little bit wrong way.
For example, take your new metadata. in the ‘samples’ column all values are unique, so ANCOM just cannot calculate anything. To resolve it, it should consist of several groups. Like ‘treated’, ‘control’ and so on, but each value should be represented by several samples.

PS.
And I still cannot understand your libraries. You had 4 libraries - A, B, C, D. Is it subsamples of the same samples or it is completely different experiments?
In your metadata, you had earlier something like this

#SampleID LibA LibB LibC LibD Treatment
s1
s2

So you have the same samples names in different libraries?
It should be more effective to get it organised like this:

#SampleID
all samples LibA
all samples LibB
all samples LibC
all samples LibD

if you want to analyse them together.
But I don’t know the design of your experiment so I can be wrong.

@timanix

You understood very well. I have four libraries at all. We can name them LibA, LibB, LibC and LibD.
Each library includes two treated and two untreated samples (16 samples).

I mean four library’s’ samples are independent. Should I analysis the compositions library by the library?

Thanks

If they are independent, you processed it independently from each other, right?
So you can analyze them separately and provide a simple metadata for each like this (for example)

sampleid   treatment
S1           control
S2           control 
S3           treated
S4           treated

No, merged the tables and sequences already. I processed them altogether in one file. I think my problem is here. If yes, I do not know how ANCOM detected it and why does not process on them in one merged file.

Just indicate in metadata which sample belongs to which library, then filter your table according to the library and you should be fine

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