This is a test version of Biostars. For the public version, visit https://www.biostars.org.
All vs. all pairwise sequence aligment

I have a fasta file with amino acid sequences. Now I want to align every sequence with every other (so it's pairwise). The outcome should be a distance (or similarity, doesn't matter) matrix.

I would like to do local alignment. EDIT: The sequences do NOT have the same length and might just have similar regions partially.

What tool would you suggest?

Ideally I can later do the same with nucleotide sequences.

alignment local fasta

4 answers

Are you really sure you need a pairwise alignment and cannot do a global alignment? It is 1000 times faster and easier.

Use R! https://cran.r-project.org/web/packages/phangorn/phangorn.pdf Page 20

library(ips)
library(phangorn)
setwd("your_working_dir")

x <- read.fas("my_aligned_fasta.fasta")
x <- as.phyDat(x)
y <- dist.ml(x, whatever you need)

This solution expects all seqs to be the same length, right?

Yes. To compare distances they must be aligned.

ClustalO can output a distance matrix (--distmat-out=<file> option).

ClustalO does multiple sequence alignment, not pairwise, right?

You can try the DIAMOND aligner: https://github.com/bbuchfink/diamond

If all you want is a distance matrix, why bother aligning at all? Try http://spaced.gobics.de/ for amino acids.

Log in to answer this question.