callWildtype: Calling Wildtype

Description Usage Arguments Details Value Author(s) Examples

View source: R/wildtype.R

Description

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

Usage

1
2
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.

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.

Value

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

Author(s)

Michael Lawrence

Examples

1
2
3
4
5
6
7
8
9
bams <- LungCancerLines::LungCancerBamFiles()
bam <- bams$H1993

data(vignette)
called.variants <- callVariants(tallies_H1993)

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

VariantTools documentation built on Nov. 8, 2020, 8:03 p.m.