This function is a wrapper of maftools::read.maf. Useless options in maftools::read.maf are dropped here. You can also use maftools::read.maf to read the data. All reference alleles and mutation alleles should be recorded in positive strand format.
read_maf(maf, verbose = TRUE)
read_maf_minimal(dt)
tab delimited MAF file. File can also be gz compressed. Required. Alternatively, you can also provide already read MAF file as a dataframe.
TRUE logical. Default to be talkative and prints summary.
A data.frame contains at least the following columns: "Tumor_Sample_Barcode", "Chromosome", "Start_Position", "End_Position", "Reference_Allele", "Tumor_Seq_Allele2"
read_maf_minimal()
: Read Maf data.frame from a minimal maf-like data
read_copynumber for reading copy number data to CopyNumber object.
# \donttest{
laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools", mustWork = TRUE)
if (!require("R.utils")) {
message("Please install 'R.utils' package firstly")
} else {
laml <- read_maf(maf = laml.maf)
laml
laml_mini <- laml@data[, list(
Tumor_Sample_Barcode, Chromosome,
Start_Position, End_Position,
Reference_Allele, Tumor_Seq_Allele2
)]
laml2 <- read_maf_minimal(laml_mini)
laml2
}
#> Loading required package: R.utils
#> Loading required package: R.oo
#> Loading required package: R.methodsS3
#> R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
#> R.oo v1.26.0 (2024-01-24 05:12:50 UTC) successfully loaded. See ?R.oo for help.
#>
#> Attaching package: ‘R.oo’
#> The following object is masked from ‘package:R.methodsS3’:
#>
#> throw
#> The following objects are masked from ‘package:methods’:
#>
#> getClasses, getMethods
#> The following objects are masked from ‘package:base’:
#>
#> attach, detach, load, save
#> R.utils v2.12.3 (2023-11-18 01:00:02 UTC) successfully loaded. See ?R.utils for help.
#>
#> Attaching package: ‘R.utils’
#> The following object is masked from ‘package:utils’:
#>
#> timestamp
#> The following objects are masked from ‘package:base’:
#>
#> cat, commandArgs, getOption, isOpen, nullfile, parse, use, warnings
#> -Reading
#> -Validating
#> -Silent variants: 475
#> -Summarizing
#> -Processing clinical data
#> --Missing clinical data
#> -Finished in 0.202s elapsed (0.237s cpu)
#> Please note that the generated MAF object is designed for mutational signature analysis, not recommended for Maftools analysis!
#> An object of class MAF
#> ID summary Mean Median
#> <char> <num> <num> <num>
#> 1: NCBI_Build NA NA NA
#> 2: Center NA NA NA
#> 3: Samples 192 NA NA
#> 4: nGenes 1 NA NA
#> 5: Unknown 1732 9.021 9
#> 6: total 1732 9.021 9
# }