R/load_data.R
extract_variants_from_matrix.RdAdd Description
extract_variants_from_matrix(
mat,
chromosome_col = "Chromosome",
start_col = "Start_Position",
end_col = "End_Position",
ref_col = "Tumor_Seq_Allele1",
alt_col = "Tumor_Seq_Allele2",
sample_col = "Tumor_Sample_Barcode",
extra_fields = NULL
)An object that inherits from classes "matrix" or "data.frame" Examples include a matrix, data.frame, or data.table.
The name of the column that contains the chromosome
reference for each variant. Default "Chromosome".
The name of the column that contains the start
position for each variant. Default "Start_Position".
The name of the column that contains the end
position for each variant. Default "End_Position".
The name of the column that contains the reference
base(s) for each variant. Default "Tumor_Seq_Allele1".
The name of the column that contains the alternative
base(s) for each variant. Default "Tumor_Seq_Allele2".
The name of the column that contains the sample
id for each variant. Default "Tumor_Sample_Barcode".
Optionally extract additional columns from the
object. Default NULL.
Returns a data.table of variants from a maf which can be used to
create a musica object.
maf_file <- system.file("extdata", "public_TCGA.LUSC.maf",
package = "musicatk")
library(maftools)
maf <- read.maf(maf_file)
#> -Reading
#> -Validating
#> -Silent variants: 206
#> -Summarizing
#> --Possible FLAGS among top ten genes:
#> TTN
#> -Processing clinical data
#> --Missing clinical data
#> -Finished in 0.068s elapsed (0.065s cpu)
variants <- extract_variants_from_maf(maf = maf)
variants <- extract_variants_from_matrix(mat = variants,
chromosome_col = "chr", start_col = "start", end_col = "end",
ref_col = "ref", alt_col = "alt", sample_col = "sample")