View source: R/align_sequences.R
| align_sequences | R Documentation |
Performs sequence alignment on two sequences by a user specified alignment method. As of now, only the Needleman-Wunsch algorithm is supported.
align_sequences(seq1, seq2, d, mismatch, match, method = "needleman")
seq1 |
First sequence to align. |
seq2 |
Second sequence to align. |
d |
Gap penalty, should be negative. |
mismatch |
Mismatch penalty, should be negative. |
match |
Match score, should be positive. |
method |
Name of alignment algorithm. Currently only supports "needleman". |
Object of class alignment representing the alignment result.
This object can be utilized with the plot.alignment function to visualize
the alignment matrix and the print.alignment function to display alignments
in the console.
For more details on the Needleman-Wunsch algorithm, see the wikipedia page.
seq1 <- "GCATGCG"
seq2 <- "GATTACA"
# Run the Needleman-Wunsch algorithm
align_sequences(seq1, seq2, d = -1, mismatch = -1, match = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.