Learn R Programming

maftools (version 0.99.30)

subsetMaf: Subset MAF

Description

Subsets MAF based on given conditions.

Usage

subsetMaf(maf, includeSyn = FALSE, tsb = NULL, genes = NULL,
  fields = NULL, query = NULL, mafObj = FALSE)

Arguments

maf

an MAF object generated by read.maf

includeSyn

to include sysnonymous variants in output

tsb

subset by these samples (Tumor Sample Barcodes)

genes

subset by these genes

fields

include only these fields along with necessary fields in the output

query

query string. e.g, "Variant_Classification == 'Missense_Mutation'" returns only Missense variants.

mafObj

returns output as MAF class MAF-class. Default FALSE

Value

subset table or an object of class MAF-class

See Also

getFields

Examples

Run this code
# NOT RUN {
laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
laml <- read.maf(maf = laml.maf, removeSilent = TRUE, useAll = FALSE)
##Select all Splice_Site mutations from DNMT3A and NPM1
subsetMaf(maf = laml, genes = c('DNMT3A', 'NPM1'),
query = "Variant_Classification == 'Splice_Site'")
##Select all variants with VAF above 30%
subsetMaf(maf = laml, query = "i_TumorVAF_WU > 30")
##Extract data for samples 'TCGA.AB.3009' and 'TCGA.AB.2933' but only include vaf filed.
subsetMaf(maf = laml, tsb = c('TCGA.AB.3009', 'TCGA.AB.2933'), fields = 'i_TumorVAF_WU')
# }

Run the code above in your browser using DataLab