generateMatrix {signeR} | R Documentation |
genCountMatrixFromVcf : generate count matrix from a VCF file.
genOpportunityFromGenome : generate opportunity matrix from a target
regions set.
genCountMatrixFromVcf(bsgenome, vcfobj) genOpportunityFromGenome(bsgenome, target_regions, nsamples=1)
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. |
A matrix of samples x (96 features).
Each feature is a SNV change with a 3bp context.
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")