It appears that matalign assumes the pfm/pcm have the same row structure (same number of rows and labels in the same order). Depending on how a pfm/pcm is constructed this may not always be true. I ran into this with AA motifs with code similar to this (with oversimplified motifs) that relied on Biostrings::consensusMatrix to construct my pfm matrices:
motifs <- list( c( "SLQRSDSSQPMLL"), c("QPMLLNTPAPVPP" ), c("AGTPIDSSQPMLL", "SLQRSDSSQPMLL" ))
pfms <- lapply(motifs, function(m)new("pfm", Biostrings::consensusMatrix(m, as.prob = TRUE), name = m[[1]]))
motifStack::motifStack(pfms, layout = "tree")
# alignment quietly fails except for some numerous but mysterious warnings
I can fix this (once I recognized the problem) as below, but it would be a nice feature of your method to check its assumptions of equivalent matrix rows and maybe order (when row names are present).
It appears that matalign assumes the pfm/pcm have the same row structure (same number of rows and labels in the same order). Depending on how a pfm/pcm is constructed this may not always be true. I ran into this with AA motifs with code similar to this (with oversimplified motifs) that relied on
Biostrings::consensusMatrix
to construct my pfm matrices:I can fix this (once I recognized the problem) as below, but it would be a nice feature of your method to check its assumptions of equivalent matrix rows and maybe order (when row names are present).
Thanks again!