extract_variants_from_matrix: Extract variants from matrix or data.frame like objects

Description Usage Arguments Value Examples

View source: R/load_data.R

Description

Add Description

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
extract_variants_from_matrix(
  mat,
  chromosome_col = "chr",
  start_col = "start",
  end_col = "end",
  ref_col = "ref",
  alt_col = "alt",
  sample_col = "sample",
  extra_fields = NULL
)

Arguments

mat

An object that inherits from classes "matrix" or "data.frame" Examples include a matrix, data.frame, or data.table.

chromosome_col

The name of the column that contains the chromosome reference for each variant. Default "Chromosome".

start_col

The name of the column that contains the start position for each variant. Default "Start_Position".

end_col

The name of the column that contains the end position for each variant. Default "End_Position".

ref_col

The name of the column that contains the reference base(s) for each variant. Default "Tumor_Seq_Allele1".

alt_col

The name of the column that contains the alternative base(s) for each variant. Default "Tumor_Seq_Allele2".

sample_col

The name of the column that contains the sample id for each variant. Default "Tumor_Sample_Barcode".

extra_fields

Optionally extract additional columns from the object. Default NULL.

Value

Returns a data.table of variants from a maf which can be used to create a bagel object.

Examples

1
2
3
4
5
maf_file <- system.file("testdata", "public_TCGA.LUSC.maf",
package = "BAGEL")
library(maftools)
maf <- read.maf(maf_file)
variants <- extract_variants_from_maf(maf = maf)

campbio/BAGEL documentation built on Oct. 6, 2020, 3:59 a.m.