Learn R Programming

VariantTools (version 1.14.1)

callWildtype: Calling Wildtype

Description

Decides whether a position is variant, wildtype, or uncallable, according to the estimated power of the given calling filters.

Usage

callWildtype(reads, variants, calling.filters, pos = NULL, ...) minCallableCoverage(calling.filters, power = 0.80, max.coverage = 1000L)

Arguments

reads
The read alignments, i.e., a path to a BAM file, or the coverage, including a BigWigFile object.
variants
The called variants, a tally GRanges.
calling.filters
Filters used to call the variants.
pos
A GRanges indicating positions to query; output is in the same order. If this is NULL, the entire genome is considered. This is not called which, because we are indicating positions, not selecting from regions.
power
The chance of detecting a variant if one is there.
max.coverage
The max coverage to be considered for the minimum (should not need to be tweaked).
...
Arguments to pass down to minCallableCoverage.

Value

A logical vector (or logical RleList if pos is NULL), that is TRUE for wildtype, FALSE for variant, NA for no-call.

Details

For each position (in the genome, or as specified by pos), the coverage is compared against the return value of minCallableCoverage. If the coverage is above the callable minimum, the position is called, either as a variant (if it is in variants) or wildtype. Otherwise, it is considered a no-call.

The minCallableCoverage function expects and only considers the filters returned by VariantCallingFilters.

Examples

Run this code
p53 <- gmapR:::exonsOnTP53Genome("TP53")
bams <- LungCancerLines::LungCancerBamFiles()
bam <- bams$H1993
tally.param <- TallyVariantsParam(gmapR::TP53Genome(), 
                                  high_base_quality = 23L,
                                  which = range(p53))
called.variants <- callVariants(bam, tally.param)

pos <- c(called.variants, shift(called.variants, 3))
wildtype <- callWildtype(bam, called.variants, VariantCallingFilters(), 
                         pos = pos, power = 0.85)

Run the code above in your browser using DataLab