Make mutation count matrix of 96 trinucleotides with transcriptional strand information

Share:

Description

Make a mutation count matrix for 96 trinucleotides, for both the transcribed and untranscribed strand of gene bodies.

Usage

1
mut_matrix_stranded(vcf_list, ref_genome, genes)

Arguments

vcf_list

List of collapsed vcf objects

ref_genome

BSGenome reference genome object

genes

GRanges object with definition of gene bodies, including strand information

Details

Mutations outside gene bodies are not counted.

Value

192 mutation count matrix (96 * 2 strands)

See Also

read_vcfs_as_granges, link{mut_matrix}

Examples

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

## You can obtain the known genes from the UCSC hg19 dataset using
## Bioconductor:
# source("https://bioconductor.org/biocLite.R")
# biocLite("TxDb.Hsapiens.UCSC.hg19.knownGene")
# library("TxDb.Hsapiens.UCSC.hg19.knownGene")

## For this example, we preloaded the data for you:
genes_hg19 <- readRDS(system.file("states/genes_hg19.rds",
                        package="MutationalPatterns"))

mut_mat_s = mut_matrix_stranded(vcfs, ref_genome, genes_hg19)

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