setMappingBiasVcf {PureCN} | R Documentation

## Set Mapping Bias VCF

### Description

Function to set mapping bias for each variant in the provided `CollapsedVCF` object. By default, it returns the same value for all variants, but a mapping bias file can be provided for position-specific mapping bias calculation.

### Usage

    setMappingBiasVcf(
      vcf,
      tumor.id.in.vcf = NULL,
      mapping.bias.file = NULL,
      smooth = TRUE,
      smooth.n = 5
    )

### Arguments

`vcf` | `CollapsedVCF` object, read in with the `readVcf` function from the VariantAnnotation package.
`tumor.id.in.vcf` | Id of tumor in case multiple samples are stored in VCF.
`mapping.bias.file` | A precomputed mapping bias database obtained by `calculateMappingBiasVcf`. instead. reference and alt counts as AD genotype field. Should be compressed and
`smooth` | Impute mapping bias of variants not found in the panel by smoothing of neighboring SNPs. Requires `mapping.bias.file`.
`smooth.n` | Number of neighboring variants used for smoothing.

### Value

Adds elements to the `vcf` `INFO` field

`bias` | A `numeric(nrow(vcf))` vector with the mapping bias of for each variant in the `CollapsedVCF`. Mapping bias is expected as scaling factor. Adjusted allelic fraction is (observed allelic fraction)/(mapping bias). Maximum scaling factor is 1 and means no bias.
`pon.count` | A `numeric(nrow(vcf))` vector with the number of hits in the `mapping.bias.file`.
`shape1, shape2` | Fit of a beta distribution.

### Author(s)

Markus Riester

### Examples

    # This function is typically only called by runAbsoluteCN via
    # fun.setMappingBiasVcf and args.setMappingBiasVcf.
    vcf.file <- system.file("extdata", "example.vcf.gz", package="PureCN")
    vcf <- readVcf(vcf.file, "hg19")
    vcf.bias <- setMappingBiasVcf(vcf)

[Package PureCN version 2.0.2 Index]