I have a multiple sequence alignment (MSA) of protein sequences, with which I have performed multidimensional scaling to visualize their clustering. Using R, I used the seqinr
package to create an identity matrix (using dist.alignment
). Is there a similar method that is more "generalizable"? Specifically, I'm interested in classifying the amino acids by some functional characteristics, such as polarity, instead of having the alignment list the amino acids by their identity (A, G, I, etc.).
Here's a very short set of fake input data, with columns 2-4 representing amino acid residue positions:
a <- c("Strain 1", "Strain 2", "Strain 3", "Strain 4")
b <- c("Polar_hydrox", "Nonpolar", "Nonpolar", "Polar_hydrox")
c <- c("Nonpolar", "Nonpolar", "Nonpolar", "Nonpolar")
d <- c("Nonpolar_cyclic", "Nonpolar_cyclic", "Polar_amide", "Polar_amide")
e <- c("Polar_amide", "Acidic", "Polar_amide", "Acidic")
x <- data.frame(a, b, c, d, e)
Is what I'm asking a feasible/correct use of MDS? Or should I be looking into a different method entirely? I attempted to use Gower's formula to create a dissimilarity matrix on the original dataset (i.e. using the actual amino acid identities instead of the functional groupings), but compared to what I got using dist.alignment
, the MDS plots look different.
Edit: Gower's formula and the dist.alignment
function are obviously calculating the distance matrices differently, but I don't know the details on the different methods. Would using Gower's formula be a good approach for calculating distance matrices for the example dataset?
Edit: clarified functions used for calculating distance matrix.