Actually would you mind sharing the code you used? My attempt is below and doesn't give the same result as yours.
df2 <- df %>%
group_by(Cell.Line, Enriched_GO_ID) %>%
mutate(Name1 = paste0(Cell.Line,row_number()))
labs <- with(df2,setNames(as.character(Cell.Line),Name1))
labs2 <- data.frame(labs)
All <- ggplot(df2, aes(x = interaction(Enriched_GO_ID, Description),
y = Name1))+
geom_tile(color = "white",
lwd = 2,
linetype = 1)+ #now have white border between them
geom_text(aes(label = Uniprot.ID), color = "white",
size = 3)+
scale_fill_fermenter(palette = "Set2", breaks = c(5,2,1.4,0))+
coord_fixed()+
scale_y_discrete(labels = df2$Cell.Line)+
labs(title = "",
y = "Cell Line Name",
x = "GO Accession ID")+
theme_classic()+ # white background
theme(axis.text.x = element_text(size = 15, angle = 90),
axis.text.y = element_text(size = 15),
axis.title = element_text(size = 20, face = "bold"))
print(All)
I can't seem to attach the image this generates but the y axis labels in my plot are A, B, A, B, A, B rather than B,B,B,A,A,A. Consequently the protein IDs don't line up with the correct cell line.