SeqAlignR {SeqAlignR} | R Documentation |
Sequence alignment and visualization tool designed to enhance understanding of sequence alignment algorithms, such as the Needleman-Wunsch algorithm. Through detailed matrix plot visualizations with arrows illustrating the path of different alignments, users can gain insights into how these algorithms score and identify optimal alignments between two sequences.
Install the SeqAlignR package from CRAN using:
install.packages("SeqAlignR")
Load the SeqAlignR package into your R session:
library(SeqAlignR)
Explore the documentation for align_sequences
or see the example below:
?align_sequences
Leonard Persson Norblad leonard.norblad@gmail.com (ORCID)
The graphics in the package were inspired by this code by Kamil Slowikowski (ORCID).
seq1 <- "GCATGCG"
seq2 <- "GATTACA"
# Run the Needleman-Wunsch algorithm
alignment1 <- align_sequences(seq1, seq2, d = -1, mismatch = -1, match = 1, method="needleman")
# Print the alignments
print(alignment1)
# Plot the matrix
plot(alignment1)