compare_alignments: Compare alternative multiple sequence alignments

Description Usage Arguments Value Note Examples

View source: R/compare_alignments.R

Description

Compare alternative multiple sequence alignments

Usage

1
compare_alignments(ref, com, SP = FALSE, CS = FALSE)

Arguments

ref

The reference MSA (in fasta, clustal, msf, phylip, mase or AAbin format)

com

The MSA to compare (in fasta, clustal, msf, phylip or mase format)

SP

Optionally also compute sum of pairs scores (default=FALSE)

CS

Optionally also compute total column score (default=FALSE)

Value

Generates an object of class "pairwise alignment comparison" (PAC), providing the optimal pairwise column alignment of two alternative MSAs of the same sequences, and summary statistics of the differences between them. The input alignments must be in the formats fasta, clustal, msf, phylip, mase or the AAbin format generated by the ape package. The details of the PAC output components are as follows:

Note

The 'compare_alignments' compares two alternative multiple sequence alignments (MSAs) of the same sequences. The alternative alignments must contain the same sequences. The function classifies similarities and differences between the two MSAs. It produces the "pairwise alignment comparison" object required as the first step any other package functions. The function converts the MSAs into matrices of sequence characters labelled by their occurrence number in the sequence (e.g. to distinguish between the first and second cysteines of a sequence). It then compares the two MSAs to determine which columns have the highest similarty between the reference and comparison MSAs to generate a similarity matrix (excluding conserved gaps). From this matrix, the comparison alignment column with the similarity to each reference alignment column is used to calculate further statistics for dissimilarity matrix, summarised for each reference MSA column in the results matrix. Lastly, it calculates the overall similarity score between the two MSAs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Using example data
data(reference_alignment)
data(comparison_alignment)
PAC <- compare_alignments(reference_alignment,comparison_alignment)

## Not run: 
# Using fasta files from your harddrive
PAC <- compare_alignments(file.choose(),file.choose())

# Using fasta files from your harddrive
library('ape')
data(woodmouse)
AA <- trans(woodmouse, 2)
PAC <- compare_alignments(AA,AA)

## End(Not run)

TS404/AlikeAlignmentAligner documentation built on Oct. 13, 2021, 4:13 p.m.