genMatrix: count matrix and opportinity matrix generators

Description Usage Arguments Value Examples

Description

genCountMatrixFromVcf : generate count matrix from a VCF file.
genOpportunityFromGenome : generate opportunity matrix from a target regions set.

Usage

1
2
    genCountMatrixFromVcf(bsgenome, vcfobj)
    genOpportunityFromGenome(bsgenome, target_regions, nsamples=1)

Arguments

bsgenome

A BSgenome object, equivalent to the genome used for the variant call.

vcfobj

A VCF object. See VCF-class from the VariantAnnotation package.

target_regions

A GRanges object, describing the target region analyzed by the variant caller.

nsamples

Number of samples to generate the matrix, should be the same number as rows of the count matrix.

Value

A matrix of samples x (96 features).
Each feature is a SNV change with a 3bp context.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(rtracklayer)
library(VariantAnnotation)

# input files, variant call and target
vcf_file <- system.file("extdata","example.vcf", package="signeR")
bed_file <- system.file("extdata","example.bed", package="signeR")

# BSgenome, will depend on your variant call
library(BSgenome.Hsapiens.UCSC.hg19)

vcfobj <- readVcf(vcf_file, "hg19")
mut <- genCountMatrixFromVcf(BSgenome.Hsapiens.UCSC.hg19, vcfobj)

target_regions <- import(con=bed_file, format="bed")
opp <- genOpportunityFromGenome(BSgenome.Hsapiens.UCSC.hg19,
    target_regions, nsamples=nrow(mut))


# see also
vignette(package="signeR")

signeR documentation built on Nov. 8, 2020, 8:08 p.m.