Learn R Programming

SeqAlignR (version 0.1.1)

print.alignment: Print Alignments

Description

Prints the alignments between seq1 and seq2 with the highest score.

Usage

# S3 method for alignment
print(x, ...)

Value

Console print of alignments.

Arguments

x

Object of class alignment (see align_sequences).

...

Additional parameters to be passed to the cat() function, displaying the alignment.

Details

The printed message includes the alignment score. This function may display multiple alignments, as alignments with the same score are possible.

Examples

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

Run the code above in your browser using DataLab