Making a legoplot of mutational signatures
1
0
Entering edit mode
3.7 years ago
zizigolu ★ 4.3k

Hi

Here doing 3D plot

https://cran.r-project.org/web/packages/barplot3d/vignettes/barplot3d.html

But I don't know from where I can provide the input as every deconvolution tools to get 3 nucleotides context returns some thing different than the example input here

enter image description here

I want to plot something like this

r • 1.1k views
ADD COMMENT
0
Entering edit mode

What data are you trying to make this from? You should try to include some of that data in the post.

ADD REPLY
0
Entering edit mode

A 96 base substitution 3D bar plot

ADD REPLY
1
Entering edit mode
3.7 years ago
zizigolu ★ 4.3k
## Prepare your own data
library(maftools)
laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
laml <- read.maf(maf = laml.maf)
laml.tnm <- trinucleotideMatrix(maf = laml, ref_genome = 'BSgenome.Hsapiens.UCSC.hg19',
                                prefix = 'chr', add = TRUE, useSyn = TRUE)

## Check the example data
library(barplot3d)
x=system.file("extdata", "signature_probabilities.txt", package = "barplot3d")
sigdata=read.table(x,header=TRUE,stringsAsFactors = FALSE)

## Make the order correct
ods = paste0(sigdata$Preceeding_base, "[",
             substr(sigdata$Substitution_type, 1, 3),
             "]", sigdata$Succeeding_base)

all(colnames(laml.tnm$nmf_matrix) %in% ods)

## Visualization
# For all samples
all_counts = rowSums(t(laml.tnm$nmf_matrix)[ods, ])
legoplot3d(contextdata=all_counts/sum(all_counts),
           labels=TRUE,scalexy=20,sixcolors="sanger",
           alpha=0.4,zsub="Probability")
ADD COMMENT

Login before adding your answer.

Traffic: 2333 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6