about MAFTOOLS and MAF files
2
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 13 months ago
Palo Alto, CA, USA

Dear all,

please could you advise on the following: I am using MAFTOOLS in order to convert an ANNOVAR file into a MAF file, for downstream analyses; however, I am getting the error message below --- any insights please about how to fix it ? thank you very much ;) !

ann.file<-read.delim("vcf.test.annovar",header=T)

ann.file$Tumor_Sample_Barcode <- "Sample_Test"
write.table(ann.file, file="ann_test.txt", row.names = FALSE, sep = "\t", quote = FALSE)

var.annovar.maf = annovarToMaf(annovar = "ann_test.txt",
                               Center = 'STANFORD', refBuild = 'hg38',
                               tsbCol = "Tumor_Sample_Barcode",table = 'refGene')

the code above works. However, when doing "getSampleSummary(var.annovar.maf)" it says :

Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ‘getSampleSummary’ for signature ‘"data.table"’
maftools genevisr • 3.1k views
ADD COMMENT
3
Entering edit mode
anand_mt ▴ 90
@anand_mt-10016
Last seen 3.6 years ago

Hi,

You need to return it as an MAF object. 

var.annovar.maf = annovarToMaf(annovar = "ann_test.txt",
                               Center = 'STANFORD', refBuild = 'hg38',
                               tsbCol = "Tumor_Sample_Barcode",table = 'refGene', MAFobj = TRUE)
ADD COMMENT
1
Entering edit mode

Thank you very much, Anand !

ADD REPLY
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 13 months ago
Palo Alto, CA, USA

Hi Anand, please may I ask you, why do the following 2 pieces of R code give different results :

-- piece 1 :

var.annovar.maf = annovarToMaf(annovar = "vcf.test.annovar_MANY.txt",
                               Center = 'STANFORD', refBuild = 'hg38',
                               tsbCol = "Tumor_Sample_Barcode",table = 'refGene', MAFobj = TRUE)

MAF <- var.annovar.maf

getSampleSummary(MAF)
getGeneSummary(MAF)
getFields(MAF)

plotmafSummary(maf = MAF, rmOutlier = TRUE, addStat = 'median', dashboard = TRUE)

-- piece 2 :

var.annovar.maf = annovarToMaf(annovar = "vcf.test.annovar_MANY.txt",
                               Center = 'STANFORD', refBuild = 'hg38',
                               tsbCol = "Tumor_Sample_Barcode",table = 'refGene')

MAF = read.maf(maf = var.annovar.maf, removeSilent = TRUE, useAll = FALSE)

getSampleSummary(MAF)
getGeneSummary(MAF)
getFields(MAF)

plotmafSummary(maf = MAF, rmOutlier = TRUE, addStat = 'median', dashboard = TRUE)

ADD COMMENT
0
Entering edit mode

i have another question, and will open a new track ;)

ADD REPLY
0
Entering edit mode

I think I found the answer in the setting up the options : removeSilent = TRUE, useAll = FALSE

ADD REPLY
0
Entering edit mode

yes that is correct. Silent variants will be kept separately from main maf file unless you specify to use them. You can access them any time at `MAF@silent`

ADD REPLY

Login before adding your answer.

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