Learn R Programming

SeqAlignR (version 0.1.1)

align_sequences: Sequence Alignment

Description

Performs sequence alignment on two sequences by a user specified alignment method. As of now, only the Needleman-Wunsch algorithm is supported.

Usage

align_sequences(seq1, seq2, d, mismatch, match, method = "needleman")

Value

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.

Arguments

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".

References

For more details on the Needleman-Wunsch algorithm, see the wikipedia page.

Examples

Run this code
seq1 <- "GCATGCG"
seq2 <- "GATTACA"
# Run the Needleman-Wunsch algorithm
align_sequences(seq1, seq2, d = -1, mismatch = -1, match = 1)

Run the code above in your browser using DataLab