Question: Hello, I am trying to make a figure like in this image. I have used Geneious but the resolution is very poor and not suitable for publication. I also tried Bio3d R-package. But could not get the desired output. Can anybody suggest how can I obtain such a figure? I could not find the proper function in bio3d package to get such a figure. Please give some suggestions.
Thank you.

![schematic of multiple sequence alignment][1]

[1]: https://i.ibb.co/2Wnt934/Screen-Shot-2020-12-15-at-13-10-38.png

Answer: **Edit: the information in this answer has been supplemented (and superseded) by what I have described in [this comment][1] in the comments section below..**

So I managed to write something in `R` that approximates this particular alignment plot from the OP given a MSA as an input.

The function (christened `msavis()`) can be found at [my GitHub repo here][2]. Refer to the in-function documentation + comments for details.

But in brief, align your sequences beforehand with your favorite alignment tool (e.g., `Mafft` or `Clustal Omega`), and save it as a `fasta` file. Then invoke `msavis()` by providing it the path to this `fasta` file along with the name of a "reference" sequence (can be any one of the sequences in the MSA; e.g., `Ref0` in the example below), and an indication of whether the reference sequence should be placed at the top (`refontop = TRUE`) or at the bottom (`refontop = FALSE`).

So if you were to test this function with the following toy MSA:

>Ref0
TTGCTACACAACAGCAACAGTCACAGACATTGTCAGTAAC---GCAGCAGCAGCAGCAGCAGAGCTCCCAGG
AGCAGCAGCTCACTTCAGTTCAGCAACCATCTCAGGCTCAGCTGACCCAGCCACCGCAACAATTTTTACAGA
CTTCTAGGTTGCTCCATGGGAATCCCTCAACTCAACTCATTCTCTCTGCTGCATTTCCTCTACAACAGAGCA
CCTTCCCTCAGTCACATCACCAGCAACATCAGTCT
>Seq1
TTGCTACACAACAGCAACAGTCACAGACATTGTCAGTAAC---TCAGCAGCGGCAGCAGCAGAGCTCCCAGG
AGCAGCAGCTCACTTCAGTTCAGCAACCATCTCAGGCTCAGCTGACCCAGCCACCGCAACAATTTTTACAGA
CTTCTAGGTTGCTCCATGGGAATCCCTCAACTCAACTCATTCTCTCTGCTGCATTTCCTCTACAACAGAGCA
CCTTCCCTCAGTCACATCACCAGCAACATCAGTCT
>Seq2
TTGCTACACAACAG---CAGTCACAGACATTGTCAGTCACACAGCAGCAGCAGCAGCAGCAGAGTGGCCAGG
AACAGCAGCTTGCTTCAGTTCAGCAACCGTCTCAGGCTCAGCTGACCCAACCACCACAGCAGTTTTTACAGA
CTTCTAGGTTGCTCCATGGGAATCCTTCAACTCAGCTTATCCTCTCTGCTGCATTTCCACTACAACAGAGCA
CTTTCCCTCAATCACATCACCAGCAGCACCAGTCT
>Seq3
TTGCTCCACAACAACCGCAGTCGCAGACACTGTCAGTCAC---------GCAGCAGCAGCAGAGTTCCCAGG
AACAGCCGCTCCCTTCAGTTCAGCAACCATCTCAGGCTCAGCTGACTCAACCACCGCAGCAGTTTCTACAGA
CTTCTAGGTTGCTCCATGGGAACCCTTCAACTCAGCTTATCCTCTCTGCTGCATTTCCTCTACAGCAGAGCA
CTTTCCCTCAGTCACATCACCAGCAACACCAGTCG
>Seq4
TTGCTCCACAACAACCGCAGTCACAGACACTGTCAGTCAC---------GCAGCAGCAGCAGAGTTCCCAGG
AACAGCCTCTCCCTTCAGTTCAGCAACCATCTCAGGCTCAGCTGACTCAACCACCGCAGCAGTTTTTACAGA
CTTCCAGGTTGCTCCATGGGAACCCTTCAACTCAGCTTATCCTCTCTGCTGCATTTCCTCTACAGCAGAGCA
CTTTCCCTCAGTCACATCACCAGCAACACCAGTCG
>Seq5
TTGCCACACAACAGCAACAGCAGCAGCAACAGCAGCAGCA---GCAGCAGCAACAGCAGCAGAGCTCCCAAG
AGCAGCAGCTTCCTGCAGTTCAGCAACCATCTCAGGCCCAGCTGACCCAGCCACCACAGCAGTTTTTACAGA
CACCTAGGTTGCTCCATGGGAATCCTTCCGCTCAGCTCATCCTCTCTGCTGCCTTTCCTCTACAACAGAGCA
CCTTCCCTCCGTCGCATCACCAGCAACACCAGCCT
>Seq6
TTGCCACACAACAGCAACAGCAGCAGCAACAGCAGCAGCA---GCAGCAGCAACAGCAGCAGAGCTCCCAAG
AGCAGCAGCTTCCTGCAGTTCAGCAACCATCTCAGGCCCAGCTGACCCAGCCACCACAGCAGTTTTTACAGA
CACCTAGGTTGCTCCATGGGAATCCTTCCGCTCAGCTCATCCTCTCTGCTGCCTTTCCTCTACAACAGAGCA
CCTTTCCTCCGTCGCATCACCAGCAACACCAGCCT

By invoking `msavis()` like so:

msavis("/path/to/test/alignment.fasta", "Ref0", refontop = TRUE)

You'd get the following plot:
![msavisinaction][3]

There's probably a lot of additional functionality that can be added to this function, but this is a start. I'm plenty sure there are a couple of bugs in there, so I'd appreciate any and all feedback.

[1]: https://www.biostars.org/p/479327/#481849
[2]: https://github.com/vragh/seqvisr
[3]: https://raw.githubusercontent.com/vragh/share/master/msavisinaction.png