Mutcraft is a package of functions to read somatic mutation information from VCF files and visualize spectra, rainplots, strand bias and mutational signatures.
library(mutcraft)
In order to extract mutation contexts and mutation strands you need to load a reference genome
library(BSgenome)
ref_genome = "BSgenome.Hsapiens.NCBI.GRCh37"
library(ref_genome, character.only = T)
my.files <- list.files(system.file("extdata", package="mutcraft"),
pattern = ".vcf", full.names = TRUE)
s.names <- c("sample1", "sample2")
mutnet <- mc.loadVcfs(my.files, s.names, ref.genome=ref_genome)
#> [1] "Loading VCFs files ..."
mutspec <- lapply(mutnet,mc.mutSpectrum,"ref.allele","alt.allele")
mc.plotSpectrum(mutspec,"prop",print.num=F)
mc.plotSpider(mutspec)
mut.c <- lapply(mutnet, mc.mutContext, ref_genome)
mc.plotContext(mut.c)
mutrain <- lapply(mutnet, mc.mutRain, "chrom","pos", "ref.allele","alt.allele")
mc.plotRain(mutrain[[1]], chrom.to.plot = c(1))