Homogenize a list of PSSM models
homogenize_pssm_models.Rd
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.
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)