Only pielou evenness resulting empty values

Hey guys,

I am using qiime2-2023.5 installed through conda.

After I runned the command:

qiime diversity core-metrics-phylogenetic
--i-phylogeny rooted-tree.qza
--i-table table-dada2.qza
--p-sampling-depth 10
--m-metadata-file sample-metadata.tsv
--output-dir core-metrics-results

All the metrics were fine, except for pielou evenness, that I discovered while plotting graphics in R multiple samples that were not filtered by -p-sampling-depth had simply empty values.


For example, samples SRR1288519 and SRR1288509 frequency on table-dada2.qza:

I tried to generate it again, but the problem is it has different rows than the others metrics and I need all the metrics to have the same number of samples to generate an R graphic. Why only pielou is retrieving empty values on samples that weren't filtered?

qiime diversity-lib pielou-evenness
--i-table filtered-table.qza
--o-vector pielou-vector.qza

qiime diversity alpha-group-significance
--i-alpha-diversity pielou-vector.qza
--m-metadata-file sample-metadata-amostras-removidas.tsv
--o-visualization pielou-vector.qzv

1 Like

Hello @Liviacmg, can you please DM me the inputs you are using so I can try to replicate this? This looks like an unfortunate case of something failing silently. Something probably went wrong but it wasn't caught and didn't generate an error and instead pretended that it worked.

I would guess they were being dropped due to this param to pielou_e (which you set in your standalone call to it there):

  --p-drop-undefined-samples / --p-no-drop-undefined-samples
                         Samples with fewer than two observed features
                         produce undefined (NaN) values. If true, these
                         samples are dropped from the output vector.

but that param isn't being set in core-metrics-phylogenetic.


Hi @Oddant1 ,

Of course. I will DM you. Yeah, I setted this parameter to only see by calculating pielou individually, the total of samples that would last.

1 Like

Hello @Liviacmg. Apologies again for the delay. Thank you for sending me your inputs. It would appear as though, at least with a sampling depth of 10, you are ending up with some samples that only have observations of one feature after rarefaction (since this seems to happen consistently it is possible that these samples do actually only have observations of one feature).

I looked into how pielou_evenness is implemented, and it would appear as though this statistic is undefined for samples that only have observations of one feature. The calculations in the background end up with -0/0 (yes -0, computers do math in silly ways) which results in NaN or "not a number." The values of those empty cells in the output are NaN.

As near as I can tell, this is correct and that statistic is indeed undefined under such circumstances. In order to avoid this, you can try running qiime feature-table filter-samples with --p-min-features 2. That should remove all samples with only one observed feature; however, post rarefaction especially with a depth of 10 there is still a chance that samples dominated by a single feature will end up with only one feature.

You may want to look at upping your sampling depth, but your data does seem fairly shallow, so you may need to use a low sampling depth.

@colinvwood and @cherman2 do either of you have any thoughts on that?


Hi @Liviacmg and @Oddant1

This is definitely whats happening. Observed features only counts unique features so even if those samples have more then 10 occurrences of that features. If its 10 occurrences of the same feature, observed features would consider that one observation.

I agree with @Oddant1 that your data looks pretty shallow, is this something you were expecting?

1 Like

Thank you for the reply @Oddant1 !

Since It is a public dataset, I wouldn't know what to expect, but It is indeed more shallow than I would expect.

Have you run alpha-rarefaction on this?
I am pretty sure this will tell you that your alpha diversity metrics never stabilize at that low of a sequencing depth.

1 Like

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