setVariantFilter {R453Plus1Toolbox} | R Documentation

## Filters output of variant information

### Description

This functions sets the filter to display only those variants, whose amplicon coverage (in percent) in forward and reverse direction in at least one sample is higher than a given value. The coverage is defined as the percentual amount of reads that cover a variant.

### Usage

    setVariantFilter(object, filter=0)

### Arguments

`object` | An instance of an `link{AVASet-class}` or `MapperSet-class`.
`filter` | A filter value between 0 and 1. If two values are given in a vector, the variants are filterd according to the forward (first value) and reverse direction (second value) separately. In this case, a variant has to meet both requirements.

### Details

Setting the filter affects the assayData and the featureData of the variant slot. See also `getVariantPercentages` for further details.

### Value

`setVariantFilter` returns the given `link{AVASet-class}`/`link{MapperSet-class}` instance with an updated filter value.

### Author(s)

Christoph Bartenhagen

### See Also

`link{AVASet-class}`, `link{MapperSet-class}`, `getVariantPercentages`.

### Examples

    # load an AVA dataset containing 6 samples, 4 amplicons and 259 variants
    data(avaSetExample)
    avaSetExample

    # use only those variants that are covered by at least 10% of all reads in one sample in both directions together (259 -> 4 variants)
    avaSetExample = setVariantFilter(avaSetExample, filter=0.1)
    avaSetExample

    # use only those variants that are covered by at least 0.1% of all reads in one sample in forward direction
    # and by at least 0% in reverse direction (259 -> 6 variants)
    avaSetExample = setVariantFilter(avaSetExample, filter=c(0.1, 0))
    avaSetExample

    # reset filter values to zero
    avaSetExample = setVariantFilter(avaSetExample, filter=0)
    # or simply
    avaSetExample = setVariantFilter(avaSetExample)

[Package R453Plus1Toolbox version 1.32.0 Index]