Compute the correlation between two given PSSMs
pssm_cor.RdThe correlation is computed by shifting the shorter PSSM along the longer one and computing the correlation at each position. The maximum correlation is returned.
Usage
pssm_cor(pssm1, pssm2, method = c("spearman", "pearson"), prior = 0.01)Arguments
- pssm1
first PSSM matrix or data frame
- pssm2
second PSSM matrix or data frame
- method
method to use for computing the correlation. See
corfor details.- prior
a prior probability for each nucleotide.
Examples
if (FALSE) { # \dontrun{
res1 <- regress_pwm(cluster_sequences_example, cluster_mat_example[, 1])
pssm_cor(res1$pssm, JASPAR_motifs[JASPAR_motifs$motif == "HNF1A", ])
} # }
# Compare two motifs from MOTIF_DB
pssm_cor(as.matrix(MOTIF_DB["HOMER.GATA3_2"]), as.matrix(MOTIF_DB["JASPAR.CDX1"]))
#> [1] 0.3846587
# Compare using different correlation methods
pssm_cor(
as.matrix(MOTIF_DB["HOMER.GATA3_2"]),
as.matrix(MOTIF_DB["JASPAR.GATA3"]),
method = "pearson"
)
#> [1] 0.2425705
pssm_cor(
as.matrix(MOTIF_DB["HOMER.GATA3_2"]),
as.matrix(MOTIF_DB["JASPAR.GATA3"]),
method = "spearman"
)
#> [1] 0.3971397