>>>>>>>>># create custom key-value pairs for 'high', 'low', 'mid' expression by fold-change
# 通过named vector⽣成⾃定义颜⾊
# t the ba colour as 'black'
keyvals <- rep('black', nrow(res2))
# t the ba name/label as 'Mid'
names(keyvals) <- rep('Mid', nrow(res2))
# modify keyvals for transcripts with fold change > 2.5
keyvals[which(res2$log2FoldChange > 2.5)] <- 'gold'
names(keyvals)[which(res2$log2FoldChange > 2.5)] <- 'high'
夏天美甲# modify keyvals for transcripts with fold change < -2.5
红掌养殖方法keyvals[which(res2$log2FoldChange < -2.5)] <- 'royalblue'
names(keyvals)[which(res2$log2FoldChange < -2.5)] <- 'low'
旋转箭头unique(names(keyvals))
unique(names(keyvals))
# define different cell-types that will be shaded
celltype1 <- c('ENSG00000106565', 'ENSG00000002933',
'ENSG00000165246', 'ENSG00000224114')
celltype2 <- c('ENSG00000230795', 'ENSG00000164530',
'ENSG00000143153', 'ENSG00000169851',
'ENSG00000231924', 'ENSG00000145681')
# create custom key-value pairs for different cell-types
# t the ba shape as '3'
keyvals.shape <- rep(3, nrow(res2))
# t the ba name/label as 'PBC'
names(keyvals.shape) <- rep('PBC', nrow(res2))
早会开场白
# modify the keyvals for cell-type 1
keyvals.shape[which(rownames(res2) %in% celltype1)] <- 17
南乡子登京口北固亭有怀辛弃疾names(keyvals.shape)[which(rownames(res2) %in% celltype1)] <- 'Cell-type 1'
# modify the keyvals for cell-type 2
keyvals.shape[which(rownames(res2) %in% celltype2)] <- 64
names(keyvals.shape)[which(rownames(res2) %in% celltype2)] <- 'Cell-type 2'
unique(names(keyvals.shape))
p1 <- EnhancedVolcano(res2,
lab = rownames(res2),
x = 'log2FoldChange',
y = 'pvalue',
lectLab = rownames(res2)[which(names(keyvals) %in% c('high', 'low'))], xlim = c(-6.5,6.5),
xlab = bquote(~Log[2]~ 'fold change'),
title = 'Custom shape over-ride',
pCutoff = 10e-14,
FCcutoff = 1.0,
transcriptPointSize = 3.5,
transcriptLabSize = 4.5,
shapeCustom = keyvals.shape,
colCustom = NULL,
colAlpha = 1,
legendLabSize = 15,
legendPosition = 'left',
legendIconSize = 5.0,
drawConnectors = TRUE,
widthConnectors = 0.5,
colConnectors = 'grey50',
gridlines.major = TRUE,
gridlines.minor = FALSE,
border = 'partial',
borderWidth = 1.5,
borderColour = 'black')
# create custom key-value pairs for 'high', 'low', 'mid' expression by fold-change
# t the ba colour as 'black'
# t the ba name/label as 'Mid'
lour) <- rep('Mid', nrow(res2))
# modify keyvals for transcripts with fold change > 2.5
lour)[which(res2$log2FoldChange > 2.5)] <- 'high'
# modify keyvals for transcripts with fold change < -2.5
lour)[which(res2$log2FoldChange < -2.5)] <- 'low'
unique(lour))
p2 <- EnhancedVolcano(res2,
lab = rownames(res2),
x = 'log2FoldChange',
y = 'pvalue',
lectLab = rownames(res2)[which(names(keyvals) %in% c('High', 'Low'))], xlim = c(-6.5,6.5),
xlab = bquote(~Log[2]~ 'fold change'),
title = 'Custom shape & colour over-ride',
pCutoff = 10e-14,
FCcutoff = 1.0,
transcriptPointSize = 5.5,
transcriptLabSize = 0.0,
shapeCustom = keyvals.shape,
colCustom = lour,
colAlpha = 1,
legendPosition = 'top',
legendLabSize = 15,
legendIconSize = 5.0,
drawConnectors = TRUE,
widthConnectors = 0.5,
colConnectors = 'grey50',
gridlines.major = TRUE,
gridlines.minor = FALSE,七夕节有哪些习俗
border = 'full',
borderWidth = 1.0,
borderColour = 'black')
library(gridExtra)
library(grid)
grid.arrange(p1, p2,
ncol=2,
top = textGrob('EnhancedVolcano',
just = c('center'),
gp = gpar(fontsize = 32)))
<(gp=gpar(fill=NA))