How do I combine MAF files with clinical data to perform clinical enrichment analysis?
1
1
Entering edit mode
2.8 years ago

I want to read into a list of MAF files and combine it with the clinical data and then perform clinical enrichment analysis.

library(maftools)

# Load MAF files (By default, silent mutations are discarded using removeSilent=TRUE; Hence, silent mutations do not need to be subsetted in Question 2)
d <- merge_mafs(lapply(Sys.glob("mafs/Patient*.maf"), read.maf))

# Load sample information
c <- read.table(file="sample-information.tsv", sep="\t", header=T)  

# Combine MAF and sample info
d <- read.maf(maf=d, clinicalData=c)

Traceback:

-Reading Error in file.info(file) : invalid filename argument

    # Clinical enrichment

    response.ce = clinicalEnrichment(maf=d, clinicalFeature="Response")

Error in `[.data.table`(getClinicalData(x = maf), ,
c("Tumor_Sample_Barcode",  :    column(s) not found: Response
maftools maf mutation • 2.7k views
ADD COMMENT
0
Entering edit mode
2.7 years ago
Gauri • 0

From what I understand, the merge_mafs function merges the MAF files and created an MAF object. The read.maf reads the MAF file (not MAF object) and creates an MAF object.

To add clinical data to the MAF object, you can try the following:

# Load MAF files (By default, silent mutations are discarded using removeSilent=TRUE; Hence, silent mutations do not need to be subsetted in Question 2)
d <- merge_mafs(lapply(Sys.glob("mafs/Patient*.maf"), read.maf))

# Load sample information
c <- read.table(file="sample-information.tsv", sep="\t", header=T)  

# Combine MAF and sample info
d@clinical.data <- c
ADD COMMENT

Login before adding your answer.

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