Composition Error!

I have an error on Differential abundance testing with ANCOM part.

In the tutorial written:
ANCOM assumes that few (less than about 25%) of the features are changing between groups. If you expect that more features are changing between your groups, you should not use ANCOM as it will be more error-prone (an increase in both Type I and Type II errors is possible).

While in my samples different ASVs. Absolutely it is not unique. Now I would like to know why it said ' there are no 'within' variance because each group of samples contains only a single sample'?


it is complaining that, using the column ‘staggeranddbarcodes’ in your metadata file, the number of different sample groups you obtaining is equal to the total number of samples, each made of one sample (these are the ‘unique values’ the error refers to). Therefore, for each of these group the script can not identify a ‘within’ variance.
Try to change the metadata column, any column for which you can split your samples in at least two groups.

1 Like

Hi Dear @llenzi,

As a matter of fact, I have three treated and three untreated replicas, altogether six samples. Two of triplets are similar to each other. I gave it to be on the line!:tulip::blush:

As you guessed my barcodes are in one column. if I want to make a modified metadata file (barcodes divide into two groups), as you told I will have two columns at least. I’d like to come to the point! in the command there is only ONE parameter for a column, is not it? So how to solve the riddle?


Hi Meha,
Good you have replicate samples!
I would not consider the barcode information in the metadata file for the ANCOM analysis, as it is NOT informative, since there is one barcode for each sample.
It would make sense start with a simple metadata file with two columns:

So you will have something like:
sample-id group
sample1 GroupA
sample2 GroupA
sample3 GroupA
sample4 GroupB
sample5 GroupB
sample6 GroupB

So, in this case you have to use
‘–metadata-column group’


1 Like

Should the parameter content be named both of the two groups’ names?
e.g. –metadata-column group A and B
Or in a different run should be each one?
It looks tricky!

Before I created a column involved treated and untreated items alongside the sample-id. It is similar method to your suggestion.
In implementation, I have no clue! Could you please give it in detail?

Hi everybody!

I got this error. How to solve this?

Plugin error from diversity:
All values in the grouping vector are unique. This method cannot operate on a grouping vector with only unique values (e.g., there are no ‘within’ distances because each group of objects contains only a single object).


Can you provide few lines of your new metadata (better if they are lines from different groups)?
It is difficult to help you more without seeing it.

I’m not sure what you mean by implementation. You used ‘treated’ and ‘untreated’ instead of "GroupA’ and ‘GroupB’ in my example above, that should be absolutely fine!
For the name of the column, you can use ‘Group A B’, however I would not keep spaces in the column name (I’m not sure if they are allowed or not).
The important thing you should be careful is to use in the ‘–metadata-column’ option the exact name you used as column name in the metadata file.

Also, what do you mean with 'in a different run should be each one? If you want to identify ASVs that are differentially abundant between GroupA and GroupB, you should keep the two groups together.


1 Like

Thanks for your understanding!

I provided the MetaData file in a photo attached here.

I understood that you are explaining that I should have special metadata file for treated and a special one for untreated samples, different two.tsv files, which there is no additional parameter in the command. I mean there is only ONE parameter for metedata file and its column. Than's all!

Anyway, I made my metadata based on the tutorial and checked it in the Kemmei tool. There is no mistake!

Now, please tell me what is the problem or in what way I have to make it to debug the error! And what is your suggestion for eradicating the error?

I had this error not only for **Differential abundance testing with ANCOM ** but also for qiime diversity beta-group-significance

I think it is a fundamental issue I should solve.



form your picture I can not spot anything wrong in the new metadata file. The only point is that for diversity and or ANCOM analysis, you can use only the ‘SampleType’ column, because is the only one in which a value is used for more than one sample.

So, form the command you showed in the initial pict in this thread, the only change you should have are:
–metadata-file ‘UseTheNameOfTheNewMetadata’
–metadata-column SampleType

As I wrote before, the barcode information in the metadata file are useful only in case you have to demultiplex some sequences, in any further analysis there is no much point on keeping them.



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