A library for working with phylogenetic and population genetic data.
v0.27.0
BalanceData Struct Reference

#include <genesis/tree/mass_tree/balances.hpp>

Detailed Description

Data needed to calculate balances.

This data is needed for calculations such as mass_balance(), phylogenetic_ilr_transform(), and phylogenetic_factorization(). Use mass_balance_data( std::vector<MassTree> const&, ... ) to calculate this data, and see BalanceSettings for the settings to tune these calculations.

Definition at line 170 of file balances.hpp.

Public Attributes

utils::Matrix< double > edge_masses
 The relative per-edge masses per original input Tree. More...
 
utils::Matrix< double > raw_edge_masses
 The absolute raw per-edge masses per original input Tree. More...
 
std::vector< double > taxon_weights
 The taxon/edge weights calculated from mulitple trees. More...
 
Tree tree
 The Tree on which to calculate balances. More...
 

Member Data Documentation

◆ edge_masses

utils::Matrix<double> edge_masses

The relative per-edge masses per original input Tree.

Each row corresponds to a Tree/Sample, each column to the edges of the trees, stored in the order of their indices.

The masses are relative, that is, they were divided by their sum per row. Furthermore, prior to this normalization, pseudeo-counts might be added to the masses in order to compensate for zero values (which are not valid in balance calculations). Also, if taxon weighing is used, the masses are divided by their weight. See BalanceSettings for the possible options for pseudo-counts. These are the values that are used for the balances computations.

In order to get the absolute masses without taxon weighing, and without normalization, see raw_edge_masses.

Definition at line 197 of file balances.hpp.

◆ raw_edge_masses

utils::Matrix<double> raw_edge_masses

The absolute raw per-edge masses per original input Tree.

Each row corresponds to a Tree/Sample, each column to the edges of the trees, stored in the order of their indices.

The masses are absolute, that is, they just add up the MassTreeEdgeData::masses per edge. Furthermore, pseudeo-counts might be added to the masses in order to compensate for zero values (which are not valid in balance calculations). See BalanceSettings for the possible options for pseudo-counts.

In order to get the final edge masses that are used in the balances computation, see edge_masses.

Definition at line 213 of file balances.hpp.

◆ taxon_weights

std::vector<double> taxon_weights

The taxon/edge weights calculated from mulitple trees.

These weights are used in soft thresholding as described in Section "Soft thresholding through weighting taxa" of [1]. See there for details. See BalanceSettings for the possible options to calculate these weights. The weights are calculated per edge of the tree, which we call taxa here, to avoid confusion of masses and weights.

[1] J. D. Silverman, A. D. Washburne, S. Mukherjee, and L. A. David, "A phylogenetic transform enhances analysis of compositional microbiota data," Elife, vol. 6, p. e21887, Feb. 2017. https://elifesciences.org/articles/21887

Definition at line 229 of file balances.hpp.

◆ tree

Tree tree

The Tree on which to calculate balances.

As multiple input tress need to have the same topology, it suffices to store just one copy. This copy is not a MassTree any more, in order to avoid accidents of trying to re-use this tree for mass calculations. Instead, it is a simple CommonTree.

Definition at line 179 of file balances.hpp.


The documentation for this struct was generated from the following file: