barplot3d|圣诞节送你一个mutation signature搭建的“乐高”

简介: barplot3d|圣诞节送你一个mutation signature搭建的“乐高”

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


上次通过deconstructSigs|探寻cosmic的独特“气质”-mutation signature !学会了如何利用deconstructSigs-R包进行mutation signature分析。

在文章最后利用每个样本的96种三碱基类型在最后绘制了柱形图,本文利用同样的数据绘制乐高图,下图为文献插图


一 mutation signature分析


快速实现mutation signature分析,得到每个样本的三碱基序列结果,详细参数详见deconstructSigs|探寻cosmic的独特“气质”-mutation signature !

library(deconstructSigs)
#查看数据
head(sample.mut.ref)
# 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")
# 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的三碱基序列百分比
sample_1$tumor

二 搭“乐高”


利用上部分得到的三碱基序列比例进行绘制:

需要注意的自己的数据与COSMIC数据的顺序要相同 !

library(barplot3d)
# Read in COSMIC signature probabilities
x=system.file("extdata", "signature_probabilities.txt", package = "barplot3d")
sigdata=read.table(x,header=TRUE,stringsAsFactors = FALSE)
# 输入文件的顺序必须与此一致
cat(sigdata$Somatic_mutation_type,sep="\n")
#使用自己的数据绘制乐高图
legoplot3d(contextdata=sample_1$tumor,labels=FALSE,scalexy=0.03)

#参数调整
legoplot3d(contextdata=sample_1$tumor,labels=FALSE,scalexy=0.01,sixcolors="broad",alpha=0.4)

scalexy:适当调整获得适当缩放的图像;

alpha:柱子的透明度;

sixcolors:默认颜色与Sanger的signature一致,可以设置为原始的Broad Institute颜色,也可以其他6种颜色。


对了,图是3D的,可以自己转,,,


相关文章
|
2月前
|
存储 Rust 安全
一篇文章讲明白Facebook币Libra学习
一篇文章讲明白Facebook币Libra学习
18 0
|
数据可视化 数据库
deconstructSigs|探寻cosmic的独特“气质”-mutation signature !
deconstructSigs|探寻cosmic的独特“气质”-mutation signature !
|
前端开发 JavaScript 区块链
PtahDao普塔道/ProTradex普瑞缇系统开发规则及玩法丨源码案例
  Dapp:代表去中心化应用程序。它们是在去中心化网络或区块链上运行后端代码(主要用Solidity编写的智能合约)的应用程序。可以使用React、Vue或Angular等前端框架构建Dapp。
|
新零售 人工智能 算法
币安链BSC盲盒游戏开发正式版丨币安链BSC盲盒游戏系统开发(逻辑及方案)丨币安链BSC盲盒游戏源码及案例
  新零售,即个人、企业以互联网为依托,通过运用大数据、人工智能等先进技术手段,对商品的生产、流通与销售过程进行升级改造,进而重塑业态结构与生态圈,并对线上服务、线下体验以及现代物流进行深度融合的零售新模式。
|
人工智能 前端开发 大数据
BSC链盲盒游戏系统开发(开发详细)丨BSC链盲盒游戏源码开发
New retail refers to a new retail model in which individuals and enterprises,relying on the Internet,upgrade and transform the production,circulation and sales process of goods by using advanced technical means such as big data,artificial intelligence and psychological knowledge,thereby reshaping th
|
JavaScript 前端开发 API
陪伴是最深情的告白,AdminWork框架升级更新摘要(一)
陪伴是最深情的告白,AdminWork框架升级更新摘要(一)
陪伴是最深情的告白,AdminWork框架升级更新摘要(一)
|
前端开发
前端工作总结218-$emit
前端工作总结218-$emit
50 0
前端工作总结218-$emit
|
前端开发
前端工作总结268-js日期操作
前端工作总结268-js日期操作
115 0
|
前端开发
冇事来学系--Vue2.0中Promise详讲(下)
then-fs的基本使用 可以通过node下载then-fs。 npm install then-fs
147 0
|
前端开发 JavaScript 数据库
冇事来学系--Vue2.0中Promise详讲(上)
回调地狱 多层回调函数的相互嵌套,就形成了回调地狱
282 0