mut_context: Retrieve context of base substitutions

View source: R/mut_context.R

mut_contextR Documentation

Retrieve context of base substitutions

Description

A function to extract the bases 3' upstream and 5' downstream of the base substitutions from the reference genome. The user an choose how many bases are extracted.

Usage

mut_context(vcf, ref_genome, extension = 1)

Arguments

vcf

A Granges object

ref_genome

Reference genome

extension

The number of bases, that's extracted upstream and downstream of the base substitutions. (Default: 1).

Value

Character vector with the context of the base substitutions

See Also

read_vcfs_as_granges,

Examples

## See the 'read_vcfs_as_granges()' example for how we obtained the
## following data:
vcfs <- readRDS(system.file("states/read_vcfs_as_granges_output.rds",
  package = "MutationalPatterns"
))

## Load the corresponding reference genome.
ref_genome <- "BSgenome.Hsapiens.UCSC.hg19"
library(ref_genome, character.only = TRUE)

## Get the standard context
mut_context <- mut_context(vcfs[[1]], ref_genome)

## Get larger context
mut_context_larger <- mut_context(vcfs[[1]], ref_genome, extension = 2)

CuppenResearch/MutationalPatterns documentation built on Nov. 23, 2022, 4:13 a.m.