FMT tutorial 1a

I'm going through the FMT tutorial using only 1% subsample data (dont have enough power for 10%) and have gotten stuck on the first question asking:

Do samples differ in composition by subject-id (i.e., across individual)?

To do this i thought id run a beta diversity analysis - beta-group-significance analysis on the unweighted_unifrac_distance_matrix.qza

here is the code i ran

qiime diversity beta-group-significance \

--i-distance-matrix core-metrics-results/unweighted_unifrac_distance_matrix.qza \

--m-metadata-file sample-metadata.tsv \

--m-metadata-column subject-id \

--o-visualization core-metrics-results/unweighted-unifrac-body-site-significance.qzv \


however i keep getting an error

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)

heres a link to the metadata file
would appreciate any feedback - i'm a total noob btw

Qiime2020.2 on VirtualBox

Hello @Tohseef, I notice you are using the results from a run of core-metrics-phylogenetic, but the FMT tutorial doesn’t run that method. Can you post the command you ran for core-metrics-phylogenetic here so I can replicate it? Thank you.

Hi thanks for the response
included screenshot here if thats easier to understand that reading the below stuff

I ran this command to generate a phylogenetic tree

qiime phylogeny align-to-tree-mafft-fasttree \

--i-sequences rep-seqs.qza \

--o-alignment aligned-rep-seqs.qza \

--o-masked-alignment masked-aligned-rep-seqs.qza \

--o-tree unrooted-tree.qza \

--o-rooted-tree rooted-tree.qza


Saved FeatureData[AlignedSequence] to: aligned-rep-seqs.qza

Saved FeatureData[AlignedSequence] to: masked-aligned-rep-seqs.qza

Saved Phylogeny[Unrooted] to: unrooted-tree.qza

Saved Phylogeny[Rooted] to: rooted-tree.qza

Then I ran this command to get core-metrics

qiime diversity core-metrics-phylogenetic \

--i-phylogeny rooted-tree.qza \

--i-table table.qza \

--p-sampling-depth 96 \

--m-metadata-file sample-metadata.tsv \

--output-dir core-metrics-results


Saved FeatureTable[Frequency] to: core-metrics-results/rarefied_table.qza

Saved SampleData[AlphaDiversity] % Properties('phylogenetic') to: core-metrics-results/faith_pd_vector.qza

Saved SampleData[AlphaDiversity] to: core-metrics-results/observed_otus_vector.qza

Saved SampleData[AlphaDiversity] to: core-metrics-results/shannon_vector.qza

Saved SampleData[AlphaDiversity] to: core-metrics-results/evenness_vector.qza

Saved DistanceMatrix % Properties('phylogenetic') to: core-metrics results/unweighted_unifrac_distance_matrix.qza

Saved DistanceMatrix % Properties('phylogenetic') to: core-metrics-results/weighted_unifrac_distance_matrix.qza

Saved DistanceMatrix to: core-metrics-results/jaccard_distance_matrix.qza

Saved DistanceMatrix to: core-metrics-results/bray_curtis_distance_matrix.qza

Saved PCoAResults to: core-metrics-results/unweighted_unifrac_pcoa_results.qza

Saved PCoAResults to: core-metrics-results/weighted_unifrac_pcoa_results.qza

Saved PCoAResults to: core-metrics-results/jaccard_pcoa_results.qza

Saved PCoAResults to: core-metrics-results/bray_curtis_pcoa_results.qza

Saved Visualization to: core-metrics-results/unweighted_unifrac_emperor.qzv

Saved Visualization to: core-metrics-results/weighted_unifrac_emperor.qzv

Saved Visualization to: core-metrics-results/jaccard_emperor.qzv

Saved Visualization to: core-metrics-results/bray_curtis_emperor.qzv

Awesome, I was able to replicate the error, and I think I have an answer.

beta-group-significance requires the ability to calculate both in group and out group differences. You can’t calculate in group differences if there’s only one member of the group. The difference between that member and itself is trivially 0, and it means nothing. So what that error is saying is basically “some of the categories you are attempting to group your data into contain only one member, which makes calculating in group differences impossible.”

Now if you look at the bottom of the subject-id column in the metadata you’ll see 5 values that are the same, up until their last two characters which are different. These 5 groups contain only one member, so in group distance can’t be calculated. I feel as though the message could perhaps be a bit more informative and tell you which group(s) the problem is coming from, but unfortunately this message originates from code that isn’t really a part of Qiime2, so I can’t change it.

As far as workarounds go, You could remove those bottom 5 rows, but then you would also have to remove those sample-ids from the actual data which would be a pain. I suggest you look into a different method of answering the question. I hope this helps.

1 Like

Ah I see, thanks for this - I’ll look into other ways of making this work!

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