Custom copy number table
3.1 GISTIC results
GISTIC会得到很多结果,此处只需要四个文件即可: all_lesions.conf_XX.txt
, amp_genes.conf_XX.txt
, del_genes.conf_XX.txt
, scores.gistic
:
#GISTIC results all.lesions =
system.file("extdata", "all_lesions.conf_99.txt", package = "maftools")
amp.genes =
system.file("extdata", "amp_genes.conf_99.txt", package = "maftools")
del.genes =
system.file("extdata", "del_genes.conf_99.txt", package = "maftools")
scores.gis =
system.file("extdata", "scores.gistic", package = "maftools")#Read GISTIC results along with MAFlaml.plus.gistic = read.maf(
maf = laml.maf,
gisticAllLesionsFile = all.lesions,
gisticAmpGenesFile = amp.genes,
gisticDelGenesFile = del.genes,
gisticScoresFile = scores.gis,
isTCGA = TRUE,
verbose = FALSE,
clinicalData = laml.clin
)#绘制含有SCNA信息的oncolpotoncoplot(maf = laml.plus.gistic, top = 20)

3.2 Custom copy-number table
可以自定义一个copy-number结果,例如,让我们在随机的 20 个样本中创建 DNMT3A 的假 SCNA变异。
set.seed(seed = 1234)
barcodes = as.character(getSampleSummary(x = laml)[,Tumor_Sample_Barcode])#Random 20 samplesdummy.samples = sample(x = barcodes,
size = 20,
replace = FALSE)#Genarate random CN status for above samplescn.status = sample(
x = c('Amp', 'Del'),
size = length(dummy.samples),
replace = TRUE)
custom.cn.data = data.frame(
Gene = "DNMT3A",
Sample_name = dummy.samples,
CN = cn.status,
stringsAsFactors = FALSE)
head(custom.cn.data)#> Gene Sample_name CN#> 1 DNMT3A TCGA-AB-2898 Amp#> 2 DNMT3A TCGA-AB-2879 Amp#> 3 DNMT3A TCGA-AB-2920 Del#> 4 DNMT3A TCGA-AB-2866 Amp#> 5 DNMT3A TCGA-AB-2892 Amp#> 6 DNMT3A TCGA-AB-2863 Amp#添加SCNA信息laml.plus.cn = read.maf(maf = laml.maf,
cnTable = custom.cn.data,
verbose = FALSE)
oncoplot(maf = laml.plus.cn, top = 10)

4 添加 significance values
输入data.frame格式的数据,包括gene
and q值
两列即可:
#MutSig resultslaml.mutsig = system.file("extdata", "LAML_sig_genes.txt.gz", package = "maftools")
oncoplot(
maf = laml,
mutsig = laml.mutsig,
mutsigQval = 0.01,
)

5 临床信息 annotations
1)使用存储在 clinical.data
中的变量进行注释
#使用FAB_classification注释oncoplot(maf = laml, clinicalFeatures = 'FAB_classification')

2)临床信息注释的变量同样可以自定义颜色:
#更改FAB classification的颜色设置fabcolors = RColorBrewer::brewer.pal(n = 8,name = 'Spectral')#颜色和变量的种类要一样多names(fabcolors) = c("M0", "M1", "M2", "M3", "M4", "M5", "M6", "M7")
fabcolors = list(FAB_classification = fabcolors)
oncoplot(
maf = laml,
clinicalFeatures = 'FAB_classification',
sortByAnnotation = TRUE,
annotationColor = fabcolors
)

3)注释多个临床数据
oncoplot(
maf = laml,
clinicalFeatures = c('FAB_classification','SEX','Overall_Survival_Status'),
annotationColor = fabcolors)

以上就是如何使用R-maftools包完成瀑布图绘制的简单介绍,然后基本上也就完成了文献的Fig1 🤭。
开篇就说了maftools对于组学数据的分析和展示来说,算是一个宝藏“R包”,因此后续还会介绍其他的汇总,分析和可视化功能。