deconstructSigs|探寻cosmic的独特“气质”-mutation signature !

简介: deconstructSigs|探寻cosmic的独特“气质”-mutation signature !

本文首发于“生信补给站”公众号  https://mp.weixin.qq.com/s/k7yzk9hPX3Bi-ohAo83ZYw


Mutational Signatures 出现在2013年的nature文章Signatures of mutational processes in human cancer中https://www.nature.com/articles/nature12477)。将mutation位置加上前后一个碱基,构成三碱基模式,然后统计96(6 * 4 * 4)种突变组合的情况。

好奇为什么是96种的,可以查一下文献

本文介绍如何利用deconstructSigs-R包进行mutation signature分析。

一 载入R包 数据

直接CRAN安装,后面再下载相应的数据库即可

#install.packages("deconstructSigs")
library(deconstructSigs)
#读入数据
head(sample.mut.ref)
Sample  chr      pos ref alt
1      1 chr1   905907   A   T
2      1 chr1  1192480   C   A
3      1 chr1  1854885   G   C
4      1 chr1  9713992   G   A
5      1 chr1 12908093   C   A
6      1 chr1 17257855   C   T
class(sample.mut.ref)
## [1] "data.frame"

只需要将自己的数据整理成以上五列(ID,chr,pos,ref,alt )信息即可,如果是TCGA中的MAF文件也是很好提取的。

mut.to.sigs.inpu


使用mut.to.sigs.input构建输入文件

使用 mut.to.sigs.input 函数,构建计算signature的输入文件,得到每个样本的96种三碱基类型。

# Convert to deconstructSigs input
sigs.input <- mut.to.sigs.input(mut.ref = sample.mut.ref,
                               sample.id = "Sample",
                               chr = "chr",
                               pos = "pos",
                               ref = "ref",
                               alt = "alt")
注:这一步也许会提示没有XX包,按照要求下载指定R包即可(也许是数据库,耐心安装)。
#查看结果信息
dim(sigs.input)
#[1] 2 96  
head(t(sigs.input)) #只有两个sample:“1”和“2”
        1 2
A[C>A]A  9 1
A[C>A]C  7 1
A[C>A]G  5 0
A[C>A]T  7 0
C[C>A]A 10 3
C[C>A]C 18 2

以上就得到了sample.mut.ref文件中每一个sample的96种三碱基类型的结果。


三 推断signature组成

3.1 使用whichSignatures推断signature的组成

# Determine the signatures contributing to the example sample1
sample_1 = whichSignatures(tumor.ref = sigs.input,
                          signatures.ref = signatures.cosmic,
                          sample.id = 1,
                          contexts.needed = TRUE,
                          tri.counts.method = 'default')

tumor.ref:每个sample的96种三碱基突变序列

signatures.ref:已知的signatures参考文件,可选signatures.nature2013和signatures.cosmic

sample.id:对应tumor.ref文件中的样本名

contexts.needed :是否需要突变上下文

tri.counts.method:三核酸序列标准化方式,默认“default” 不进行标准化 ;或者选择exome,genome,exome2genome,genome2exome 来限定区域。


3.2 查看返回结果

#查看结果
class(sample_1)
# [1] "list"
#查看权重结果
sample_1$weights
#输出tumor的三碱基序列百分比
sample_1$tumor
#三碱基序列百分比 * 权重
sample_1$product

whichSignatures会输出5个元素的list文件:

  • weights -- data frame containing the weights assigned to each of the k signatures of the input signatures matrix
  • tumor -- matrix of the trinucleotide contexts for the tumor sample used as input
  • product -- matrix obtained when the tumor matrix is multiplied by the assigned weights
  • diff -- matrix representing the difference between the tumor matrix and product matrix
  • unknown -- numeric weight not assigned to any of the input signatures

3.3 指定signature权重

通过associated参数指定参与计算的signature

sample_1.associate = whichSignatures(tumor.ref = sigs.input,
                          signatures.ref = signatures.cosmic,
                          sample.id = 1,
                          associated = c("Signature.1","Signature.22"),
                          contexts.needed = TRUE,
                          tri.counts.method = 'default')
sample_1.associate$weights

3.4 设定signature的阈值

通过signature.cutoff设定阈值,小于此值的为0

sample_1.cutoff = whichSignatures(tumor.ref = sigs.input,
                          signatures.ref = signatures.cosmic,
                          sample.id = 1,
                          contexts.needed = TRUE,
                          signature.cutoff = 0.08 ,
                          tri.counts.method = 'default')
sample_1.cutoff$weights

四 signature可视化

使用plotSignatures 参数可视化

# Plot example
plot_example <- whichSignatures(tumor.ref = sigs.input,
                      signatures.ref = signatures.cosmic,
                      sample.id = 1)
# Plot output
plotSignatures(plot_example, sub = 'example')

查看sample1的signature的组成情况,就是上面plot_example$weight , plot_example$tumor , plot_example$product 的结果可视化。

相关文章
|
19天前
|
资源调度 前端开发 JavaScript
第十章(应用场景篇) Single-SPA微前端架构深度解析与实践教程
第十章(应用场景篇) Single-SPA微前端架构深度解析与实践教程
系列文章深度解读|SwiftUI 背后那些事儿
前言 今年苹果的WWDC你看了吗?苹果在2019年的WWDC的重头戏当然非SwiftUI莫属:全新的声明式语法、绑定式API、和响应式变成框架Combine。这一切的一切都预示着即将在Apple Native布局系统掀起一场革命。
17579 0
|
8月前
|
人工智能 自然语言处理
如何理解人工智能领域 LLM 的 No notion of time or chronological order 这一局限性?
如何理解人工智能领域 LLM 的 No notion of time or chronological order 这一局限性?
38 1
|
12月前
barplot3d|圣诞节送你一个mutation signature搭建的“乐高”
barplot3d|圣诞节送你一个mutation signature搭建的“乐高”
|
机器学习/深度学习 存储 人工智能
开放API如何处理数据隐私问题?看看GPT-3 是怎么做的
开放API如何处理数据隐私问题?看看GPT-3 是怎么做的
531 0
|
存储 JavaScript 中间件
深入理解 ngrx effect 背后的工作机制
深入理解 ngrx effect 背后的工作机制
146 0
深入理解 ngrx effect 背后的工作机制
|
算法 区块链 数据安全/隐私保护
BlockChain:《Blockchain Gate》听课笔记——以POW机制为例阐述共识机制的激励相容设计
BlockChain:《Blockchain Gate》听课笔记——以POW机制为例阐述共识机制的激励相容设计
|
机器学习/深度学习 数据采集 算法
打破传统降噪算法|AliDenoise的背后技术
近年电商直播越来越火热,同时移动端直播变得越来越普及,直播场景也越来越多样化,不再限于传统的直播间,开阔喧嚷的户外、喧闹的商场甚至是市场都可以变成主播直播的根据地。影响直播最终观感最直接的两个因素就是画面和声音,场景的复杂化对传统的实时音频信号处理算法提出了更大的挑战,其中最直观的一个现象就是,场景变吵了,声音听起来不干净,这就是音频3A算法中的降噪算法需要处理的问题。
打破传统降噪算法|AliDenoise的背后技术
|
缓存 移动开发 前端开发
从 SWR 开始 — 一窥现代请求 hooks 设计模型
本文将以 swr 为例子,讲述现在最热门的 useRequest、swr 和 react-query 三个请求 hooks 的新机制,以及新机制后 class Component 和 hooks 在设计上的区别。
从 SWR 开始 — 一窥现代请求 hooks 设计模型
|
安全 C# C语言
艾伟_转载:把Array说透
  1. 数组大局观   数组是一个引用类型,也就是意味着数组的内存分配在托管堆上,并且我们在栈上维护的是他的指针而并非真正的数组。接下来我们分析下数组的元素,其中的元素无外乎是引用类型和值类型。
983 0

热门文章

最新文章