Making a legoplot of mutational signatures
1
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)
library( barplot3d)
x= system.file( "extdata" , "signature_probabilities.txt" , package = "barplot3d" )
sigdata= read.table( x,header= TRUE,stringsAsFactors = FALSE)
ods = paste0( sigdata$Preceeding_base , "[" ,
substr( sigdata$Substitution_type , 1, 3) ,
"]" , sigdata$Succeeding_base )
all( colnames( laml.tnm$nmf_matrix ) %in% ods)
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" )
Login before adding your answer.
Traffic: 3760 users visited in the last hour
What data are you trying to make this from? You should try to include some of that data in the post.
A 96 base substitution 3D bar plot