【工具】ReConPlot一个可视化和解释基因组重排的R包

文章目录

介绍

人类肿瘤的全基因组测序研究表明,复杂形式的结构变异,统称为复杂基因组重排(cgr),在不同类型的癌症中普遍存在。cgr的检测、分类和机制解释需要对体细胞拷贝数畸变(SCNAs)和结构变异(SVs)的复杂模式进行可视化。然而,缺乏专门设计的工具来促进cgr的可视化和研究。

我们提出了ReConPlot(重排和拷贝数图),这是一个R包,提供了跨一条或多条染色体的scna和sv的联合可视化功能。ReConPlot是基于流行的ggplot2包,从而允许定制的情节和生成出版质量的数字以最小的努力。总的来说,ReConPlot促进了CGR模式的探索、解释和报告。

Abstract

Motivation

Whole-genome sequencing studies of human tumours have revealed that complex forms of structural variation, collectively known as complex genome rearrangements (CGRs), are pervasive across diverse cancer types. Detection, classification, and mechanistic interpretation of CGRs requires the visualization of complex patterns of somatic copy number aberrations (SCNAs) and structural variants (SVs). However, there is a lack of tools specifically designed to facilitate the visualization and study of CGRs.

Results

We present ReConPlot (REarrangement and COpy Number PLOT), an R package that provides functionalities for the joint visualization of SCNAs and SVs across one or multiple chromosomes. ReConPlot is based on the popular ggplot2 package, thus allowing customization of plots and the generation of publication-quality figures with minimal effort. Overall, ReConPlot facilitates the exploration, interpretation, and reporting of CGR patterns.

代码

https://github.com/cortes-ciriano-lab/ReConPlot/tree/main

案例

r 复制代码
devtools::install_github("cortes-ciriano-lab/ReConPlot")

复杂的基因组畸变在不同类型的癌症中普遍存在,并且通常与肿瘤的发展和治疗耐药性有关。

下一代测序的出现促进了癌症基因组畸变的研究。

体细胞拷贝数谱和结构变异(SVs)的存在表明染色体结构和数量的变化。

通常需要可视化sv和拷贝数畸变来识别支持观察到的模式的基因组不稳定机制,并解释基因组改变的功能后果,例如肿瘤抑制因子的缺失或癌基因的扩增。

目前,有几种类型的可视化来研究基因组重排。

其中包括Circos图,基因组显示为圆形,体细胞改变显示为同心圆轨迹,以及二维基因组重排图,其中拷贝数谱和SVs映射到一条或多条染色体并排显示。

虽然没有单一的可视化可以包含在癌症中观察到的复杂基因组畸变的复杂性,但基因组重排谱对于解释癌症基因组学数据和在出版物中报告基因组学分析结果非常有用。

然而,用于可视化基因组重排图谱的文库缺乏,这阻碍了研究和科学结果的可重复性。

在这里,我们介绍R包ReConPlot ,它提供了副本数配置文件和sv的可视化功能。

该软件包依赖于公共软件包,包括流行的ggplot2,因此允许进一步定制绘图。

为了可视化基因组重排谱,ReConPlot 需要常用床格式的结构变异和拷贝数数据。

对于SV, ReConPlot 使用断点符号来促进与符合以vcf格式报告SV的最佳实践的任何SV调用者的兼容性。

虽然ReConPlot 的主要焦点是癌症背景下复杂体细胞拷贝数和SVs的可视化,但提供的功能可用于非癌症样本的基因组数据可视化,例如正常组织中检测到的体细胞畸变,单细胞全基因组数据或其他。

目前ReConPlot支持构建人类参考基因组GRCh37、GRCh38和T2T-CHM13,小鼠参考基因组mm10和mm39。

加载R包

r 复制代码
library(tidyverse)
library(ReConPlot)

导入数据

r 复制代码
data(test_data)

包的主要功能是ReConPlot

该函数为上面在chr_selection data.frame中定义的基因组区域生成重排图。

除了SV和拷贝数信息外,有必要指出要显示哪些基因组区域。

这是使用指示染色体的数据框架以及每个染色体的起始和结束位置来定义的。

请参见下面的示例。

如果要显示整个染色体,起始位置需要设置为0,结束位置可以设置为大于人类染色体长度的值,例如250Mbp(1号染色体的大小为~249Mbp)。

r 复制代码
chrs=c("chr10")
chr_selection = data.frame(
  chr=chrs,
  start=rep(0 ,length(chrs)),
  end=rep (250000000, length(chrs))
)

一旦定义了感兴趣的区域,我们就可以生成图了。

例如,我们可以绘制10号染色体的基因组重排图谱:

r 复制代码
plot = ReConPlot(sv_data,
cn_data,
chr_selection=chr_selection,
legend_SV_types=T,
pos_SVtype_description=115000000,
scale_separation_SV_type_labels=1/23,
title="Example")

print(plot)

在本例中,总拷贝数和次要拷贝数数据分别以黑色和红色显示,位于UCSC基因组浏览器中报告的Giemsa染色注释表示的顶部。

根据全基因组泛癌症分析计划(PCAWG)建立的符号,sv以弧线表示。

任意分配给每种SV类型的颜色显示在左侧的图例中(参见下面修改图形参数的选项)。

根据断点处的读取方向,将sv分为4类:类删除sv(±)、类重复sv(-+)和反转sv(++和------)。

根据我们的经验,每条染色体的宽度为6厘米,每条染色体的高度为5厘米,足以显示重排图,并将其保存在出版物中。

如果我们想可视化10号染色体的焦点区域,我们可以通过指定感兴趣的区域然后应用函数来实现:

r 复制代码
chrs=c("chr10")
chr_selection = data.frame(
  chr=chrs,
  start=rep(40000000 ,length(chrs)),
  end=rep (55000000, length(chrs))
)

plot = ReConPlot( sv_data,
cn_data,
chr_selection=chr_selection,
scale_ticks=1000000,
color_minor_cn="steelblue2",
size_title = 7,
legend_SV_types=T,
pos_SVtype_description=1000000,
scale_separation_SV_type_labels=1/18,
max.cn = 4,
curvature_intrachr_SVs = -0.12,
title="Example of a focal region in chr10")

print(plot)

我们还可以使用参数scaling_cn_SVs 来改变SV和拷贝数图的相对跨度,默认值为1/6。

吉姆萨染色轨道的尺寸可以使用参数upper_limit_karyotypekaryotype_rel_size进行修改。

r 复制代码
chrs=c("chr10")
chr_selection = data.frame(
  chr=chrs,
  start=rep(40000000 ,length(chrs)),
  end=rep (55000000, length(chrs))
)

plot = ReConPlot( sv_data,
cn_data,
chr_selection=chr_selection,
scale_ticks=1000000,
color_minor_cn="steelblue2",
size_title = 7,
legend_SV_types=T,
scaling_cn_SVs = 1/18,
upper_limit_karyotype = -0.1, 
karyotype_rel_size = 0.3,
pos_SVtype_description=1000000,
scale_separation_SV_type_labels=1/23,
curvature_intrachr_SVs = -0.1,
max.cn = 4,
title="Example of a focal region in chr10")

print(plot)

染色体间易位或有一个断点落在chr_selection 视点之外的sv可以用参数label_interchr_SV=TRUE 标记目的染色体。

这种设置对简单的SVs有用,但不建议用于涉及小区域内多个易位的复杂基因组重排的基因组区域。

r 复制代码
chrs=c("chr10")
chr_selection = data.frame(
  chr=chrs,
  start=rep(40000000 ,length(chrs)),
  end=rep (55000000, length(chrs))
)

plot = ReConPlot( sv_data,
cn_data,
chr_selection=chr_selection,
scale_ticks=1000000,
color_minor_cn="steelblue2",
size_title = 7,
legend_SV_types=T,
scaling_cn_SVs = 1/18,
pos_SVtype_description=1000000,
scale_separation_SV_type_labels=1/23,
curvature_intrachr_SVs = -0.1,
max.cn = 4,
title="Example of a focal region in chr10 with TRA labels",
label_interchr_SV=TRUE)

print(plot)

我们也可以画出几条染色体。

在这种情况下,还显示涉及所选染色体集的染色体间SVs。

根据我们的经验,多染色体图的宽度为19cm会得到很好的结果。

请注意,这是大多数发布组中图形的最大宽度。

上面的图是使用默认参数值生成的。

但是,可以修改一些图形参数。

例如,我们可以使用"color_minor_cn"参数改变次要拷贝号段的颜色。

我们可以使用参数"genes"输入一个基因列表,以显示相关基因的基因组位置,例如下面的TP53。

其他可用选项如下所示,并在包文档中进行了描述。

以上翻译结果来自有道神经网络翻译(YNMT)· 通用场景

r 复制代码
chrs=c('chr1',"chr9","chr10","chr17")
chr_selection = data.frame(
  chr=chrs, #factor(chrs,levels=chrs),
  start=rep(0 ,length(chrs)),
  end=rep (250000000, length(chrs))
)
r 复制代码
plot = ReConPlot( sv_data,
cn_data,
chr_selection=chr_selection,
genes=c("MDM2","MYC","TP53","CDK4","EGFR","PTEN"),
title="Multichromosomal example with gene names",
size_gene_label = 2,
pos_SVtype_description=1000000,
color_minor_cn="steelblue2",
size_title = 7,
size_chr_labels=5,
legend_SV_types=T,
scale_separation_SV_type_labels=1/23,
max.cn = 4,
scale_ticks=20000000)

print(plot)

We can focus on specific regions of interest across multiple chromosomes:

r 复制代码
chrs=c("chr9","chr10","chr17")
chr_selection = data.frame(
  chr=chrs,
  start=c(30, 40, 0) * 1000000,
  end=c(40, 60, 15) * 1000000
)
r 复制代码
plot = ReConPlot( sv_data,
cn_data,
chr_selection=chr_selection,
genes=c("MDM2","MYC","TP53","CDK4","EGFR"),
title="Multichromosomal example with gene names",
size_gene_label = 2,
pos_SVtype_description=1000000,
color_minor_cn="steelblue2",
scale_separation_SV_type_labels=1/23,
size_title = 7,
size_chr_labels=7,
legend_SV_types=T,
curvature_interchr_SVs = -0.08,
max.cn = 8,
scale_ticks=5000000)

print(plot)

上面的例子显示了具有相对较少数量的sv的染色体。

然而,可视化更复杂的模式是可能的,比如在这个样本中的12号染色体中检测到的那些:

r 复制代码
chrs=c('chr1',"chr9","chr12")
chr_selection = data.frame(
  chr=chrs,
  start=rep(0 ,length(chrs)),
  end=rep (250000000, length(chrs))
)
r 复制代码
plot = ReConPlot( sv_data,
cn_data,
chr_selection=chr_selection,
genes=c("MDM2","MDM4","MYC","CDK4","EGFR","CDKN2A","CCND2"),
title="Multichromosomal example with gene names showing highly rearranged chromosomes",
size_gene_label = 2,
pos_SVtype_description=1000000,
color_minor_cn="steelblue2",
size_title = 7,
size_chr_labels=7,
legend_SV_types=T,
scale_separation_SV_type_labels=1/23,
max.cn = 10,
scale_ticks=20000000)

print(plot)

最后,通过提供包含列"chr"、"pos"和"y"的数据框以及参数custom_annotation ,可以在ReCon图下面添加注释图。

只显示chr_selection 视图中的点。

"y"可以表示用户定义的尺度。

在下面的例子中,我们用snv对图进行注释,其中"y"表示等位基因频率。

请注意控制注释图的不同视觉方面的其他参数。

r 复制代码
head(snv_data)
r 复制代码
chrs=c("chr10")
chr_selection = data.frame(
  chr=chrs,
  start=rep(0 ,length(chrs)),
  end=rep (250000000, length(chrs))
)

plot = ReConPlot(sv_data,
cn_data,
chr_selection=chr_selection,
legend_SV_types=T,
pos_SVtype_description=115000000,
scale_separation_SV_type_labels=1/23,
title="Example with annotation",
curvature_intrachr_SVs=-.05,
custom_annotation=snv_data,
ann_dot_col="darkred",
ann_dot_size=.5,
ann_y_title="SNV-VAF", 
#Label for y-axis
ann_rel_size=.4
#Relative size to main plot
)

print(plot + theme(plot.margin=margin(t=1, unit = "cm")))

ReCon图是ggplot对象,可以在生成后进行修改。

它们可以很容易地保存为PDF文件。

根据我们的经验,以下维度对出版质量的数据和书面报告很有效。

如果将注释图与ReCon图结合使用,则可能需要增加高度。

r 复制代码
ggsave(filename = "example_ReConPlot.pdf", plot = p, width = 19, height = 5, units = "cm")

参考

  • ReConPlot: an R package for the visualization and interpretation of genomic rearrangements
相关推荐
陈敬雷-充电了么-CEO兼CTO1 小时前
推荐算法系统系列>推荐数据仓库集市的ETL数据处理
大数据·数据库·数据仓库·数据挖掘·数据分析·etl·推荐算法
麻雀无能为力2 小时前
CAU数据挖掘 支持向量机
人工智能·支持向量机·数据挖掘·中国农业大学计算机
DataGear17 小时前
如何在DataGear 5.4.1 中快速制作SQL服务端分页的数据表格看板
javascript·数据库·sql·信息可视化·数据分析·echarts·数据可视化
shootero@126.com1 天前
R语言开发记录,二(创建R包)
r语言
程序员阿超的博客1 天前
Python 数据分析与机器学习入门 (五):Matplotlib 数据可视化基础
python·信息可视化·数据分析·matplotlib·数据可视化·python教程·pyplot
顾道长生'1 天前
(Arxiv-2024)自回归模型优于扩散:Llama用于可扩展的图像生成
计算机视觉·数据挖掘·llama·自回归模型·多模态生成与理解
shootero@126.com1 天前
R语言开发记录,一
开发语言·r语言
旷世奇才李先生1 天前
R 语言安装使用教程
开发语言·r语言
好开心啊没烦恼1 天前
Python:线性代数,向量内积谐音记忆。
开发语言·python·线性代数·数据挖掘·数据分析
过期的秋刀鱼!1 天前
用“做饭”理解数据分析流程(Excel三件套实战)
数据挖掘·数据分析·excel·powerbi·数据分析入门