[BioC] unexpected behaviour of pairwiseAlignment() in Biostrings

Coghlan, Avril A.Coghlan at ucc.ie
Thu Jan 28 13:12:44 CET 2010


Dear all,

I have been using the pairwiseAlignment() function in the Biostrings
library for creating global alignments.

However, I noticed that the way it behaves is not quite like I expected.


For example, I wanted to create a global alignment of sequences
"HEIAKGKAL" and "HEIAKGKALIIIIEALKCLA" so I typed:
> x1 <- "HEIAKGKAL"
> y1 <- "HEIAKGKALIIIIEALKCLA"
> pairwiseAlignment(x1,y1, substitutionMatrix = BLOSUM62, gapOpening =
-1,gapExtension=-1)
Global PairwiseAlignedFixedSubject (1 of 1)
pattern: [1] HEIAKGKAL 
subject: [1] HEIAKGKAL 
score: 37

The output that I got seems to be a local alignment, as it doesn't
contain the whole of the two input sequences.
Therefore, I am wondering if this function is using the Needleman-Wunsch
algorithm to make the global alignment, or not?
It looks to me like this actually the result of the Smith-Waterman
algorithm for local alignment. 

By the way, I still get the same result when I explicitly use the
"type=global" option:
> pairwiseAlignment(x1,y1, substitutionMatrix = BLOSUM62, gapOpening =
-1 ,gapExtension=-1,type='global')
Global PairwiseAlignedFixedSubject (1 of 1)
pattern: [1] HEIAKGKAL 
subject: [1] HEIAKGKAL 
score: 37

Just to check that I am not going crazy, I tried aligning the same
sequences using needle from the EMBOSS package (which does
Needleman-Wunsch global alignments) at
http://mobyle.pasteur.fr/cgi-bin/portal.py?form=needle with gapOpening
and gapExtension penalties of -1, and the BLOSUM62 matrix. It gave the
best global alignment as:
x1                 1 HEIAKGKAL-------      9
                     |||||||||       
y1                 1 HEIAKGKALEALKCLA     16
Score: 45.0
This is something like I would have expected pairwiseAlignment() to give
me, ie. a global alignment spanning the full lengths of the two
sequences.

Please could you explain why pairwiseAlignment is not giving me a global
alignment? I am very confused, and am wondering if I am being very
stupid and have misunderstood something (probably!)..

Regards,
Avril

Avril Coghlan
Dept. Microbiology
University College Cork
Ireland



More information about the Bioconductor mailing list