I am wondering whether it would be possible to represent the Multi_Hit bar as a splitted one like in TCGAbiolinks oncoprints:

Here is the explanation for my question: I was previously using TCGAbiolinks. Trying to optimize the oncoprints for our study, I found then maftools to be the best for the data presentations. The only one thing, which IMHO is not perfect enough, is the Multi_Hits. Because we have several genes with "Multi_Hits"mutations, the gene mutation frequency is not the same as it would be with the in TCGAbiolinks: it will count as one mutation event per patient:

The sorting of the patients seems to be better in maftools.
1 answer
For the oncoprints that do well displaying multi hits, you are using the ComplexHeatmap package, right? I also had to spend a while trying best to arrange these and I eventually found that I could do it (arrange samples) manually using the following parameters to the oncoPrint() function:
- row_order=NULL
- column_order=MySampleOrder
In my situation, I had divided my samples into 4 or 5 groups based on a different metric (not mutations or mutation frequencies). I therefore needed to order them both by group and mutation number, which oncoprint() couldn't do. So, I tabulated the mutations myself and produced my own sample order listing (MySampleOrder).
After that, after calling the draw() function, I overlayed vertical lines on the oncoprint in order to visually segregate my sample groups. The following code allows you to draw a line, but positioning can be difficult (and I know that you didn't specifically ask for this in your question):
decorate_heatmap_body("MyOncoprint",
{
i <- which(sample.order.White.new=="Sample010")
x <- i/ncol(MyDataFrame)
grid.lines(c(x, x), c(-0.5, 1.25), gp=gpar(lwd=1.5, lty=2))
grid.text("My vertical\nline", x, unit(1,"npc")+unit(5, "mm"), just="center", hjust=1.05, vjust=-0.5, gp=gpar(fontsize=8.5, fontface="bold"))
})
Log in to answer this question.