A quick question on “Biostrings” package
1
0
Entering edit mode
happymonan • 0
@happymonan-16019
Last seen 2.0 years ago
United States

Hi, I am learning the package “Biostrings” and I want to use this package to calculate the Smith-Waterman matrix for my two DNA sequences. Should I use the pairwiseAlignment fuction and choose type=”local”? More specifically, is the local type the Smith-Waterman algorithm by default?

Thank you so much!

Code should be placed in three backticks as shown below


# include your problematic code here with any corresponding output 
# please also include the results of running the following in an R session 

sessionInfo( )
local Smith-Watermanmatrix; Biostrings; • 743 views
ADD COMMENT
1
Entering edit mode
@herve-pages-1542
Last seen 1 day ago
Seattle, WA, United States

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.

ADD COMMENT
0
Entering edit mode

Thank you so much for your help, Hervé!

ADD REPLY

Login before adding your answer.

Traffic: 472 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