Question: Error in score() function on pairwiseAlignment()
gravatar for jdydu
2.9 years ago by
jdydu0 wrote:

I ran the following example from page 6 of the PairwiseAlignment documentation (

> submat <- matrix(-1, nrow = 26, ncol = 26, dimnames = list(letters, letters))
> diag(submat) <- 0
> psa2 <- pairwiseAlignment(pattern = c("succeed", "precede"), subject = "supersede", substitutionMatrix = submat, gapOpening = 0, gapExtension = 1)
> score(psa2)
Error in UseMethod("score") :
  no applicable method for 'score' applied to an object of class "c('PairwiseAlignmentsSingleSubject', 'PairwiseAlignments')"
> traceback()
1: score(psa2)

The expected output according to the manual is:

> score(psa2) [1] -5 -5


> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)

[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats4    parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] seqinr_3.1-3        ade4_1.7-4          ggplot2_2.1.0       Biostrings_2.38.4  
[5] XVector_0.10.0      IRanges_2.4.8       S4Vectors_0.8.11    BiocGenerics_0.16.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.4      grid_3.2.2       plyr_1.8.3       gtable_0.2.0     scales_0.4.0    
 [6] zlibbioc_1.16.0  labeling_0.3     tools_3.2.2      munsell_0.4.3    colorspace_1.2-6

I've just downloaded this package using:


Thank you!



ADD COMMENTlink modified 2.9 years ago by shepherl ♦♦ 1.2k • written 2.9 years ago by jdydu0
Answer: Error in score() function on pairwiseAlignment()
gravatar for shepherl
2.9 years ago by
shepherl ♦♦ 1.2k
United States
shepherl ♦♦ 1.2k wrote:


The attached package seqinr also has score() which is masks the Biostrings score().  If you change 




you should get the result expected.  Another solution would be to not load seqinr in the same session as Biostrings. 


ADD COMMENTlink written 2.9 years ago by shepherl ♦♦ 1.2k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 430 users visited in the last hour