I have a following dataframe:
readname <- c("tic", "tac", "toe")
sequence <- c("TTTTTTTTATTTTTA","TTTTCTTTTTTTTT","GTTTTTTT")
df <- data.frame(readname, sequence)
and I want to plot it using ggplot2, so the y axis would contain "readname" column and the strings stored in column "sequence" would be plotted horizontally, one below the other, all aligned to right. I would also like to assign color to every letter (e.g. A - red, T - blue, C - green, G - yellow).
I tried to use geom_text() but I produce either empty plots or plot every string on the same level (collapsed) or plotted on the various levels, unaligned. The same applies to geom_label().
One of my attempts:
ggplot2::ggplot(df, aes(x=sequence, y=readname)) + ggplot2::geom_label(label=sequence)
Here is something I would like to achieve (from text editor):

