consensusString fails for AAMultipleAlignment object
0
0
Entering edit mode
Diego Diez ▴ 760
@diego-diez-4520
Last seen 3.4 years ago
Japan

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.

biostrings • 670 views
ADD COMMENT

Login before adding your answer.

Traffic: 876 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6