plot_log_odds: Plot Log-Odds Before and After Transformation

View source: R/plot_log_odds.R

plot_log_oddsR Documentation

Plot Log-Odds Before and After Transformation

Description

This function calculates the log-odds ratio before and after applying a transformation to multiple matrices, and generates a bar plot comparing the log-odds values. The log-odds are calculated using a specified function (default is log_odds_dc).

Usage

plot_log_odds(
  matrices,
  new_matrices,
  names_matrices,
  log_odds_general = log_odds_dc
)

Arguments

matrices

A list of matrices for which the log-odds are calculated before the transformation.

new_matrices

A list of matrices for which the log-odds are calculated after the transformation.

names_matrices

A vector of names corresponding to the matrices in matrices and new_matrices.

log_odds_general

A function used to calculate the log-odds (default is log_odds_dc).

Value

A bar plot showing the log-odds before and after the transformation for each matrix and overall.

Examples

# Example matrices and names
matrices <- list(matrix(c(1, 2, 3, 4), nrow = 2), matrix(c(2, 3, 4, 5), nrow = 2))
new_matrices <- list(matrix(c(5, 6, 7, 8), nrow = 2), matrix(c(4, 5, 6, 7), nrow = 2))
names_matrices <- c("Matrix1", "Matrix2")
plot_log_odds(matrices, new_matrices, names_matrices)


covalchemy documentation built on April 12, 2025, 2:15 a.m.