Description Usage Arguments Value Note Examples
View source: R/compare_alignments.R
Compare alternative multiple sequence alignments
1 | compare_alignments(ref, com, SP = FALSE, CS = FALSE)
|
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) |
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:
reference_P The numbered character matrix of the reference alignment
comparison_Q The numbered character matrix of the comparison alignment
results_R The results summary matrix (containing column averages of match, gapcon, merge, split, shift)
similarity_S The similarity matrix between the reference and comparison alignment columns
dissimilarity_D The dissimilarity matrix between the reference and comparison (containing match, gapcon, merge, split, shift)
dissimilarity_simple The dissimilarity matrix with categories stacked into a single 2D matrix
columnmatch The column of the comparison alignment with the highest final match score
cys The proportion of cysteines (relevant for cysteine rich proteins)
reflen The length of the reference alignment
comlen The length of the comparison alignment
refcon The consensus sequence of the reference alignment
comcon The consensus sequence of the comparison alignment
similarity_score The overall similarity score
column_score The proportion of columns that are fully identical between the reference and comparison MSAs and related data (optional)
sum_of_pairs The sum of pairs score and related data (optional)
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.