With this code I have this complexheatmap
library(dplyr)
library(rafalib)
library(RColorBrewer)
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("genefilter")
library(genefilter)
library(gplots)
library(ComplexHeatmap)
library(circlize)
library(scales)
library(stringr)
library(reshape2)
library(Seurat)
library(limma)
library(dropbead)
library(sctransform)
library(Matrix)
library(ggrepel)
library(viridis)
library(tidyverse)
library(cowplot)
left_annotation = rowAnnotation(Peak = anno_text(left_anno$Peak),
Percentage = anno_barplot(left_anno$Percentage_altered_nr,
gp = gpar(fill = "gold"),
axis_param = list(direction = "reverse"),
width = unit(20, "mm"),ylim = c(0, 70))
right_annotation = rowAnnotation(Percentage = anno_barplot(right_anno$Percentage_altered_r,
gp = gpar(fill = "gold"),
width = unit(20, "mm"),ylim = c(0, 60)
))
Heatmap(mat, border = T, show_column_names = F,
rect_gp = gpar(col = "white", lwd = 1),
column_split = response$response,
col = col_fun,
show_column_dend = F,
show_row_dend = F,
left_annotation = left_annotation,
right_annotation = right_annotation,name = "CNV")
[![enter image description here][1]][1]
This is my R object
1- The problem is, in the blocks the colors are discret but in the legend you are seeing 1 0 -1 -2
. How I can change the so in the legend I have red
as Amp
, blue
as Del
and grey
as Netral
please?
2- How I can make the genes to italic ?