Counts ref and alt reads for a set of mutations in a bam file

get_mutations_read_counts(mutations, bam, tag = "",
  min_base_quality = 20, max_depth = 1e+05, min_mapq = 30)

Arguments

mutations

A data frame with the reporter mutations. Should have the columns CHROM, POS, REF, ALT.

bam

path to bam file

tag

the RG tag if the bam has more than one sample

min_base_quality

minimum base quality for a read to be counted

max_depth

maximum depth above which sampling will happen

min_mapq

the minimum mapping quality for a read to be counted

Value

a named list contains: ref, vector of read counts of the reference alleles, and alt, vector of read counts of the alternative allele

Details

Quantifies the reference and variant alleles for the input mutations in the input bam file. Useful for forced calling mutations.

See also

get_mutations_read_names test_ctDNA get_mutations_fragment_size

Examples

data("mutations", package = "ctDNAtools") bamT1 <- system.file("extdata", "T1.bam", package = "ctDNAtools") get_mutations_read_counts(mutations = mutations[1:3, ], bam = bamT1)
#> $ref #> [1] 445 447 373 #> #> $alt #> [1] 2 3 1 #>