Entering edit mode
I get the error:
Error in cmat[codes, , drop = FALSE] : subscript out of bounds
It seems consensusString calls consensusMatrix, which returns the letter probabilities for the standard amino acids:
rownames(consensusMatrix(aln)) [1] "-" "A" "C" "D" "E" "F" "G" "H" "I" "K" "L" "M" "N" "P" "Q" "R" "S" "T" "V" "W" "Y"
However, at some point consensusString subsets that using names(AMINO_ACID_CODE):
names(AMINO_ACID_CODE) [1] "A" "R" "N" "D" "C" "Q" "E" "G" "H" "I" "L" "K" "M" "F" "P" "S" "T" "W" "Y" [20] "V" "U" "O" "B" "J" "Z" "X"
The code doing this is in MultipleAlignment.R:
setMethod("consensusString","AAMultipleAlignment",
function(x, ambiguityMap="?", threshold=0.5)
{
callNextMethod(x, ambiguityMap=ambiguityMap, threshold=threshold,
codes=names(AMINO_ACID_CODE))
}
)
I tested changing names(AMINO_ACID_CODE) above by AA_STANDARD and it fixes the problem but not sure whether that is the intended behavior.
