## generate tallies
library(VariantTools)
bams <- LungCancerLines::LungCancerBamFiles()
tally.param <- TallyVariantsParam(gmapR::TP53Genome(),
high_base_quality = 23L,
which = gmapR::TP53Which())
tallies <- tallyVariants(bams$H1993, tally.param)
sampleNames(tallies) <- "H1993"
mcols(tallies) <- NULL
## we assume the coverage is already stored as a BigWigFile
bwf <- rtracklayer::export(coverage(bams$H1993), "coverage.bw")
## simple usage
genotypes <- callGenotypes(tallies, bwf, BPPARAM=BiocParallel::SerialParam())
## write to gVCF
writeVcf(genotypes, tempfile("genotypes", fileext="vcf"), index=TRUE)
## customize
params <- CallGenotypesParam(gmapR::TP53Genome(), p.error = 1/1000)
callGenotypes(tallies, bwf, params)
Run the code above in your browser using DataLab