This function scans the targets regions in one bam file, and reports the number of reference, non-reference reads for each loci in addition to the non-reference (VAF) allele frequency. Loci with VAF higher than vaf_threshold are masked with NA. This function is used internally by create_background_panel
create_background_panel_instance(bam, targets, reference,
vaf_threshold = 0.05, tag = "", min_base_quality = 20,
max_depth = 1e+05, min_mapq = 30, substitution_specific = TRUE)
A character specifying the path to bam file.
The targets data frame must have the columns chr, start and end.
The reference genome as BSgenome object.
Loci with the fraction of non-reference reads above this value are masked with NA.
The RG tag in the bam file. Empty string defaults to using the whole bam.
The minimum base quality to count a read for a loci.
Maximum depth for the pileup
The minimum mapping quality to count a read for a loci
logical, whether to have the loci by substitutions.
A named list having depth, alt and vaf data frames. Each has the same order of loci in rows and the input sample in columns.