I need to customise the colour code for protein multiple sequence alignment (MSA), However the existing R packages only supports the predefined colour codes, which are single letter based. But, I have to assign my own colour scheme for a pair of letters (amino acid). I have gone through the packages like ggmsa and ggplot2 etc., but failed to find the solution. I need to generate a figure as shown below, I tried with the following scripts but failed to complete my task for the test files as follows,
msa.fasta >Tl8 NI-NG-HD-NS-N*-NU >T_X12 NI-NG-NI-NG-NI-NG-NI-NG >T_T_x56 NI-NG-HD-NS-N*-NI-NG
library(tidyverse) library(ggtree) library(seqinr) tree = read.tree("tree.newick") msaplot(p=ggtree(tree), fasta = "msa.fasta") msaplot(p=ggtree(tree) + geom_tiplab(align=TRUE), fasta = "msa.fasta")
But with the above script I could only end up with single letter colour code without any changes. Therefore, Kindly help me to do the same.