Make mutation count matrix of 96 trinucleotides

Share:

Description

Make 96 trinucleotide mutation count matrix

Usage

1
mut_matrix(vcf_list, ref_genome)

Arguments

vcf_list

List of collapsed vcf objects

ref_genome

BSGenome reference genome object

Value

96 mutation count matrix

See Also

read_vcfs_as_granges,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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"))

## Exclude mitochondrial and allosomal chromosomes.
autosomal <- extractSeqlevelsByGroup(species="Homo_sapiens",
                                        style="UCSC",
                                        group="auto")

vcfs <- lapply(vcfs, function(x) keepSeqlevels(x, autosomal))

## 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 = vcfs, ref_genome = ref_genome)

## Et voila.
mut_mat

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.