Read a MAF into R with options for what columns to keep (default all columns will be returned).

fread_maf(maf_file_path, select_cols, return_cols = FALSE)

Arguments

maf_file_path

Path to maf that is about to be read.

select_cols

Optional parameter for specifying what columns are to be returned. If not specified, all columns will be kept.

return_cols

Optional parameter for returning the names of all available MAF columns. If set to TRUE a character vector of column names will be returned, and no MAF will be read. Default is FALSE.

Value

A data table containing MAF data from a MAF file.

Details

This function lets the user specify a path to a MAF file on disk, this function then reads this MAF into R. The user has the option to keep specific columns from the incoming MAF file (default is to keep all columns). To return all available columns, set return_cols = TRUE. For specifying columns of interest, refer to the select_cols parameter. For more information, refer to the parameter descriptions as well as function examples.

Examples

if (FALSE) {
#read a maf into R with all columns kept
my_maf = fread_maf(maf_file_path = "some_directory/this_is_a.maf")

#return what columns are available
maf_cols = fread_maf(return_cols = TRUE)

#read maf with only a selection of columns
my_maf = fread_maf(maf_file_path = "some_directory/this_is_a.maf", 
                   select_cols = c(Hugo_Symbol = "character",
                                   Chromosome = "character",
                                   Start_Position = "integer",
                                   End_Position = "integer",
                                   Variant_Type = "character"))
}