create_bagel: Creates a bagel object from a variant table

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
11
12
13
14
create_bagel(
  x,
  genome,
  check_ref_chromosomes = TRUE,
  check_ref_bases = TRUE,
  chromosome_col = "chr",
  start_col = "start",
  end_col = "end",
  ref_col = "ref",
  alt_col = "alt",
  sample_col = "sample",
  extra_fields = NULL,
  verbose = TRUE
)

Arguments

x

Any object that can be coerced to a data.table including a matrix or data.frame.

genome

A BSgenome object indicating which genome reference the variants and their coordinates were derived from.

check_ref_chromosomes

Whether to peform a check to ensure that the chromosomes in the variant object match the reference chromosomes in the genome object. If there are mismatches, this may cause errors in downstream generation of count tables. If mismatches occur, an attept to be automatically fix these with the seqlevelsStyle function will be made. Default TRUE.

check_ref_bases

Whether to check if the reference bases in the variant object match the reference bases in the genome object. Default TRUE.

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

Which additional fields to extract and include in the bagel object. Default NULL.

verbose

Whether to print status messages during error checking. Default TRUE.

Value

Returns a bagel object

Examples

1
2
3
4
5
maf_file <- system.file("testdata", "public_TCGA.LUSC.maf",
package = "BAGEL")
variants <- extract_variants_from_maf_file(maf_file)
g <- select_genome("38")
bagel <- create_bagel(x = variants, genome = g)

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