core-metrics-phylogenetic and negative eigenvalues

miniconda3 v23.5.0 ; q2cli v2023.5.1

Hi there,

When running my data through core-metrics-phylogenetic I am getting warnings (below) that indicate:

  1. Data in my Feature Table was converted to boolean for metric jaccard
  2. There are negative eigenvalues in the PCoA step of ordination

So I have a few questions regarding this warning. Firstly, do I need to be worried that my Feature Table was modified or is this only a temporary modification for this analysis? Secondly, what exactly is the significance of these negative eigenvalues? Lastly, the warning states that if the negative values are smaller in magnitude than some of the largest positive values "it's probably safe to ignore them". So in what instances would it not be safe?

Thanks a ton for your time and assistance!

Code Ran

qiime diversity core-metrics-phylogenetic \
  --i-phylogeny 16S_rooted_tree_fasttree.qza \
  --i-table denoised_16S_seqs_featuretable_v01.qza \
  --p-sampling-depth 20862 \
  --m-metadata-file metadata.txt \
  --output-dir core_phylogenetic_metrics_sampling_depth_9620_2020_08_14 \
  --verbose > 16S_core_metrics_SD_20862.txt

Warning

/home/bene/miniconda3_21_06_23/envs/qiime2-2023.5-new/lib/python3.8/site-packages/sklearn/metrics/pairwise.py:1776: DataConversionWarning: Data was converted to boolean for metric jaccard
  warnings.warn(msg, DataConversionWarning)
/home/bene/miniconda3_21_06_23/envs/qiime2-2023.5-new/lib/python3.8/site-packages/skbio/stats/ordination/_principal_coordinate_analysis.py:143: RuntimeWarning: The result contains negative eigenvalues. Please compare their magnitude with the magnitude of some of the largest positive eigenvalues. If the negative ones are smaller, it's probably safe to ignore them, but if they are large in magnitude, the results won't be useful. See the Notes section for more details. The smallest eigenvalue is -0.014972519824755106 and the largest is 3.4281055055832415.
  warn(
/home/bene/miniconda3_21_06_23/envs/qiime2-2023.5-new/lib/python3.8/site-packages/skbio/stats/ordination/_principal_coordinate_analysis.py:143: RuntimeWarning: The result contains negative eigenvalues. Please compare their magnitude with the magnitude of some of the largest positive eigenvalues. If the negative ones are smaller, it's probably safe to ignore them, but if they are large in magnitude, the results won't be useful. See the Notes section for more details. The smallest eigenvalue is -0.0024230574242903114 and the largest is 0.3007891520736592.
  warn(

Visual inspection of bray_curtis_emperor.qzv for negative values

Hello @Ben_E, it looks like in your instance it is probably not safe to ignore them. Particularly in the x-axis the negative values are of the same order of magnitude as the positive values, they also aren't too far off on the y-axis. This is not indicative of anything wrong with your data, but it does suggest that this metric is unlikely to be helpful in analyzing your data.

2 Likes

Thanks for the reply @Oddant1!

I'm just hung up on one thing. From my understanding, eigenvalues aren't what are plotted, rather, the vectors resulting from the multiplication of the eigenvalues and the input vectors are. If you look at the warning it states that:

...The smallest eigenvalue is -0.014972519824755106 and the largest is 3.4281055055832415.
...
...The smallest eigenvalue is -0.0024230574242903114 and the largest is 0.3007891520736592.

Which, if you are going by the tip in the warning about magnitudes it should be fine to ignore them. I just don't know how to find the eigenvalues to manually inspect them...

1 Like

My bad, you are correct about the magnitudes of the eigenvalues. It is only not safe to ignore them if, as the warning suggests, the negative ones are similar in size to (or even larger than) the positive ones. If you want to actually view all of the eigenvalues I'm not sure if there is a really good way to do it, but if you open the relevant pcoa .qza, then open the data folder and "ordination.txt" the eigenvalues should be listed at the top of the file.

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