Last data update: 2014.03.03

R: Compare alternative multiple sequence alignments
compare_alignmentsR Documentation

Compare alternative multiple sequence alignments

Description

Compare alternative multiple sequence alignments

Usage

compare_alignments(ref, com, SP = FALSE)

Arguments

ref

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

com

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

SP

Optionally also compute sum of pairs scores (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 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

  • sum_of_pairs The sum of pairs score and related data (optional)

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

data(reference_alignment)
data(comparison_alignment)
PAC <- compare_alignments(reference_alignment,comparison_alignment)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(AlignStat)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AlignStat/compare_alignments.Rd_%03d_medium.png", width=480, height=480)
> ### Name: compare_alignments
> ### Title: Compare alternative multiple sequence alignments
> ### Aliases: compare_alignments
> 
> ### ** Examples
> 
> data(reference_alignment)
> data(comparison_alignment)
> PAC <- compare_alignments(reference_alignment,comparison_alignment)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>