How to convert maf file format to oncoPrint matrix (ComplexHeatmap package)?
1
1
Entering edit mode
5.2 years ago

I have maf files and I'd like to create a oncoPrint matrix with my own data according to https://jokergoo.github.io/ComplexHeatmap-reference/book/oncoprint.html. However, the input format for oncoPrint is:

##    s1          s2          s3         
## g1 "snv;indel" "snv"       "indel"    
## g2 ""          "snv;indel" "snv"      
## g3 "snv"       ""          "indel;snv"

The maf file format is:

##Hugo_Symbol   Variant_Classification  Tumor_Sample_Barcode
##g1    Missense_Mutation   s1
##g1    Splice_Site s1
##g2    Missense_Mutation   s1
##g2    Missense_Mutation   s2
##g2    Frame_Shift_Ins s2
##g3    Missense_Mutation   s3

Is there a tool to convert maf to the oncoPrint format?

Many thanks!

R OncoPrint ComplexHeatmap • 4.0k views
ADD COMMENT
1
Entering edit mode

Thanks for this - I actually did it - it worked nicely in maftools. However, MAFTOOLS is not able to show genes with more than one variant type (multihit) as half (or proportion) of each variant in the cell (see https://github.com/PoisonAlien/maftools/issues/246). I need a more detailed plot using ComplexHeatmap or other package to show different variants in the same cell. Any recommentation?

ADD REPLY
0
Entering edit mode

Did you found any solution?

ADD REPLY
0
Entering edit mode

Hi there,

Actually I used the [maftools] package. I loaded my maf file using 'read.maf' function and then used the 'oncoplot' function to plot - you can create a OncoPrint matrix by including the 'writeMatrix = TRUE' argument.

Hope it helps!

ADD REPLY
0
Entering edit mode

Thanks for sharing. However, I already did that. Following is the outline of the code

colnames(data2) <- c("Samples","Gene","Impact")
### remove duplicate rows
data <-data[!duplicated(data[,]),]
for(i in 1:nrow(data)) {

  for(j in 1:nrow(data)) {

      if(identical(data[i,1], data[j,1]) && identical(data[i,2], data[j,2]) && data[i,3] != data[j,3]){

    data[i,3] <- paste0(data[i,3],";",data[j,3])
    data<- data[-j,]

  }}}
ADD REPLY
0
Entering edit mode

Hi Dear,

Were you able to do that? I wanted to convert my MAF file in Matrix format for Oncoprint as well.

Thanks Najeeb

ADD REPLY
0
Entering edit mode
5.2 years ago
dodausp ▴ 190

Have you tried using maftools?

It is a very handy package if you are working with MAF files. It summarizes, analyzes, annotates and visualizes MAF files in a quite nice way. Among many functions, you can plot your oncoprint there as well.

I hope it helps. Good luck!

ADD COMMENT

Login before adding your answer.

Traffic: 2610 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