Skip to contents

This function adjusts each PSSM model in the input list so that the GC content is not higher than the AT content. If a model's GC content is higher than its AT content, the function applies a reverse complement to the model using the prego pssm_rc function.

Usage

homogenize_pssm_models(models)

Arguments

models

A list of PSSM models. Each model should be a list with a pssm element, which is a data frame containing columns 'A', 'C', 'G', 'T', and 'pos'.

Value

A list of homogenized PSSM models.

Examples

# Create simulated data
pssm1 <- data.frame(
    pos = 1:4,
    A = c(0.1, 0.2, 0.3, 0.4),
    C = c(0.3, 0.3, 0.2, 0.1),
    G = c(0.3, 0.3, 0.3, 0.3),
    T = c(0.3, 0.2, 0.2, 0.2)
)
pssm2 <- data.frame(
    pos = 1:4,
    A = c(0.1, 0.2, 0.3, 0.4),
    C = c(0.1, 0.1, 0.1, 0.1),
    G = c(0.2, 0.2, 0.2, 0.2),
    T = c(0.6, 0.5, 0.4, 0.3)
)

models <- list(list(pssm = pssm1), list(pssm = pssm2))

# Homogenize the models
homogenized_models <- homogenize_pssm_models(models)