acidbase.log_ratio_to_fold_change

acidbase.log_ratio_to_fold_change(x: float | ndarray, base: int = 2) float | ndarray

Convert log ratio to fold change.

Parameters:
  • x (float or array-like) – Log-ratio values.

  • base (int) – Logarithm base (default 2).

Returns:

Fold-change values.

Return type:

float or numpy.ndarray

Notes

Matches R’s logRatioToFoldChange semantics: after exponentiation, any result < 1 is replaced by -1 / result to give a negative fold change representing down-regulation.