Hi,
Please consult the man page of the pairwiseAlignment
function in the Biostrings package (open it with ?pairwiseAlignment
). The Description section at the top of the page says:
Description:
Solves (Needleman-Wunsch) global alignment, (Smith-Waterman) local
alignment, and (ends-free) overlap alignment problems.
Should I use the pairwiseAlignment fuction and choose type=”local”?
There are many ways to set the type
argument e.g. it can be set to "global-global"
, "global-local"
, "local-global"
, "local-local"
, and more... All of them are described in the man page. More generally speaking, the type
value is a string made of two parts, the left and right parts, separated by a hyphen (-
). One part describes how the pattern
should be treated, and the other part describes how the subject
should be treated. For example, if we want to find the best alignment between the full pattern
sequence and a subsequence of the subject
, then type
should be set to "global-local"
.
All this to say that the choice for type
is usually driven by what we want the function to achieve, and not so much by what algorithm exactly the function is going to use behind the scene to achieve that goal. In other words: choose the type of alignment based on your goal, and not based on implementation details.
In addition to the man page of the pairwiseAlignment
function, you might also want to take a look at the "Pairwise Sequence Alignments" vignette in the Biostrings package. See the Biostrings landing page here for a link to this vignette.
Hope this helps,
H.
Thank you so much for your help, Hervé!