griffithlab / GenVisR

Genome data visualizations
Creative Commons Zero v1.0 Universal
206 stars 62 forks source link

waterfall plot "plotMutBurden" function #384

Open u1200538 opened 2 years ago

u1200538 commented 2 years ago

Hi! I'm using the function waterfall from GenVisR package. As the vignette suggests, I want to change the top plot with custom values. However, I cannot find any option to modified these plot. As you see the below images, top plot seperated 3 kinds of the translational effect. those values cannot be specified and appear in gray as "Undefined".

[https://stackoverflow.com/questions/49644304/waterfall-plot-genvisr]

Q1. Is it possible to customize the Mutation Burden plot ? I want to change the Translational Effect category.

Q2. And I want to know how to decide the Translational Effect (Synonymous, Non Synonymous) by following Mutation type?? If the mutation type is "silent", the translational effect is specified as sysnonymous I think, but I'm not sure if all mutation types except "silent" are designated as nonsynonymous.

mutationData <- read.table('input5D_Group1.txt', sep='\t', header=TRUE) Samplelist <- read.table('Samplelist.txt', sep='\t', header=TRUE) clinicalData <- melt(data=Samplelist, id.vars=c("sample")) mutation_priority<- c("Missense, Splice site, Nonsense","Frameshift ins/del., Inframe ins/del.", "silent","UTR","Up, Downstream gene variant") waterfall(mutationData, fileType = "Custom", variant_class_order=mutation_priority, clinData=clinicalData, clinVarCol=c('Group1'='#5CD1E5'), mainPalette = c("Missense, Splice site, Nonsense"='#2F9D27',"Frameshift ins/del., Inframe ins/del."='#FF9436',"UTR"='#FF1493',"Up, Downstream gene variant"='#7B68EE'), sampOrder=Samplelist$sample[Samplelist$group=="Group1"], plotSamples=Samplelist$sample[Samplelist$group=="Group1"], rmvSilent=TRUE, mainDropMut=TRUE, maxGenes = 1000, section_heights=c(1, 10, 0.5), clinLegCol=3, mainXlabel=TRUE, coverageSpace=1000000)

zlskidmore commented 2 years ago

The current waterfall() function cannot do this, however I have an improved one (I plan on deprecating this one), that you might be able to get to do what you want.

Specifically the new one can take a coverage argument which is a named vector corresponding to each sample in order to calculate mutation burden. Further you can tell GenVisR to split up these calculations by the mutation type, see plotATally="complex"

There is a vignette for the new functionality here: https://pubmed.ncbi.nlm.nih.gov/34506690/

Can you take a look and see if the newer function can accomplish what you want? If not I'm happy to discuss further