Recalculate RPCA and coordinate axis was reversed

Hi friends in qiime2,

I am using robust Aitchison principal-component analysis.
I found a problem confusing me a lot.
After excluding the 20% cases and re-calculating distance matrix and PCA. The top and bottom 10 ASVs with highest and lowest feature loadings of PC1, PC2 and PC3 from RPCA was reversed. To make it clear, let me make an example, oBacte.323ed2 had the lowest feature loading (say -0.05) before re-calculating, but it turned to the highest feature loading (+0.05). I copies my code calculating the matrix and RPCA.

 qiime feature-table filter-samples \
  --i-table $table_dir/sample_table.qza \
  --m-metadata-file $map_dir/dat_427_20220206.tsv \
  --o-filtered-table distance$table_dir/asv_table_427_20220206.qza 
  qiime deicode rpca \
    --i-table $table_dir/asv_table_427_20220206.qza \
    --p-min-feature-count 0 \
    --p-min-sample-count 6500 \
    --o-biplot $pcoa_dir/DEICODE_PCA_427_20220206.qza \
    --o-distance-matrix $diversity_dir/DEICODE_427_20220206.qza
  qiime emperor biplot \
    --i-biplot $pcoa_dir/DEICODE_PCA_427_20220206.qza \
    --m-sample-metadata-file $map_dir/dat_427_20220206.tsv \
    --m-feature-metadata-file $table_dir/taxa.tsv \
    --o-visualization $qiime_dir/biplot_DEICODE_427_20220206.qzv \
    --p-number-of-features 8   # select top 8 features

Does the 20% cases weigh a lot on RPCA, or we could say the absolute values of feature loadings are the most important, rather than the original value?

Thanks in advance.

1 Like

@cmartino Dear Cameron,

Thanks for the great paper on RPCA.
If you are available, could I invite you to comment on this topic? Thanks a lot.


Hi @11132,

Thank you for using RPCA, and kind words, I hope it is helpful.

Are the samples also changing sign? If so, this is normal. In PCA (and PCoA) the sign can flip arbitrarily when run multiple times because the sign of the loadings is meaningless. The features loadings/rankings should be interpreted only with respect to the orientation of the samples in the plot.