I have two group of strains that I'm comparing. Each group has ~100 sequences. I align the groups together with MAFFT. The issue I have when I then visualize the alignment, is that there are numerous sites where one or two sequences have insertions, causing an insertion for the entire alignment. This makes it difficult for me to assess the overall differences between the groups. I'm wondering if there is a way to solve this? I'm thinking if there is a way to hide positions with xx % "–" characters? That way, I can ignore positions where a single sequence has an insertion.
2 answers
seqmagick has a --squeeze-threshold option that does just this. For example with an MSA of five sequences with one long one (80% gaps at those positions):
$ seqmagick convert --squeeze-threshold 0.9 aln.fa -
>seq1
ACGT----ACGT
>seq2
ACGT----ACGT
>seq3
ACGT----ACGT
>seq4
ACGTGTACACGT
>seq5
ACGT----ACGT
$ seqmagick convert --squeeze-threshold 0.5 aln.fa -
>seq1
ACGTACGT
>seq2
ACGTACGT
>seq3
ACGTACGT
>seq4
ACGTACGT
>seq5
ACGTACGT
You can try https://github.com/inab/trimal
Log in to answer this question.