mia
mia copied to clipboard
calculateAitchison
I propose to add a function calculateAitchison
.
This would be similar to calculateUnifrac
but it will not require tree and it will return Aitchison distances.
These are defined as Euclidean distances between clr-transformed values, by default calculated from the assay="counts" or assay="relabundances" (which should lead to same result, consider including a unit test for that..).
The user should be able to choose between standard (default; with clr) and robust (optional; with rclr) transformation as part of the distance calculation.
The advantage is to standardize this calculation, it has become a relatively common choice and fluent access is needed for comparison purposes.
The default names given for the distances would be "Aitchison distance" and "Robust Aitchison distance"
As an alternative to implementing mia::calculateAitchison
function, one can use method "aitchison" through coda.base::dist function because in most cases a user can just call a specific external distance function for runMDS and other ordinations: d <- coda.base::dist(X, method = 'aitchison')
. The limitation with this is that the "Robust Aitchison" option is not available in standard distance functions as far as I know, this would require PR to vegan::vegdist or coda.base::dist or some other distance function, to add both Aitchison and Robust Aitchison. In principle, that would be perhaps even better solution than implementing our own versions of some rather general distances.