Hi,
Based on two sequences from the book: Sequence Alignment Methods, Models, Concepts,and Strategies Edited by Michael S. Rosenberg.
I run the following script:
> library(Biostrings)
> s1 <- "GGAATGG"
> s2 <- "ATG"
> sigma <- nucleotideSubstitutionMatrix(match = 2, mismatch = -1, baseOnly = TRUE)
> globalAligns1s2 <- pairwiseAlignment(s1, s2, type="global", substitutionMatrix = sigma, scoreOnly = FALSE)
> globalAligns1s2 # Print out the optimal alignment and its score
With the following output:
Global PairwiseAlignmentsSingleSubject (1 of 1)
pattern: [1] GGAATGG
subject: [1] AT----G
score: -26
Based on the book results I should get an alignment score of -5 and one of these alignment:
GGAATGG
---ATG-
Or
GGAATGG
---AT-G
Or
GGAATGG
--A-TG-
Or
GGAATGG
--A-T-G
Any help or idea what I did wrong?
Thanks
Try tweaking the gapOpening and gapExtension parameters to be lower values, such as -2 and -1.
I tried without success. The parameters in the book where:
Match score = +1.
Mismatch score = -1.
Gap score = -2.