mut_matrix: Make mutation count matrix of 96 trinucleotides

View source: R/mut_matrix.R

mut_matrixR Documentation

Make mutation count matrix of 96 trinucleotides

Description

Make 96 trinucleotide mutation count matrix

Usage

mut_matrix(vcf_list, ref_genome, extension = 1)

Arguments

vcf_list

GRangesList or GRanges object.

ref_genome

BSgenome reference genome object

extension

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

Value

96 mutation count matrix

See Also

read_vcfs_as_granges

Examples

## See the 'read_vcfs_as_granges()' example for how we obtained the
## following data:
grl <- 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)

## Construct a mutation matrix from the loaded VCFs in comparison to the
## ref_genome.
mut_mat <- mut_matrix(vcf_list = grl, ref_genome = ref_genome)

## Construct a mutation matrix with a larger context.
## This is most usefull when you have many mutations per sample.
mut_mat_extended <- mut_matrix(vcf_list = grl, ref_genome = ref_genome, extension = 2)

UMCUGenetics/MutationalPatterns documentation built on Nov. 24, 2022, 4:31 a.m.