freqAnnotate: Annotate SVs with frequency in catalog

View source: R/freqAnnotate.R

freqAnnotateR Documentation

Annotate SVs with frequency in catalog

Description

Input SVs are matched to SVs in the catalog. Each SV is then annotated with the maximum frequency across all the variants in the catalog that match. Although the different overlap approaches could be used here, the 'reciprocal' overlap makes the more sense because we want to list all possible matches without penalizing over-matching (like 'bipartite' would) or include fragmented calls (like 'coverage' would) as they could be very variants with uncomparable frequencies.

Usage

freqAnnotate(
  svs,
  cat,
  min.ol = 0.5,
  min.del.rol = 0.1,
  max.ins.dist = 20,
  check.inv = FALSE,
  range.seq.comp = FALSE,
  ins.seq.comp = FALSE,
  out.vcf = NULL,
  freq.field = "AF",
  out.freq.field = "AFMAX",
  method = c("reciprocal", "coverage", "bipartite"),
  nb.cores = 1,
  log.level = c("CRITICAL", "WARNING", "INFO")
)

Arguments

svs

a VCF object with SVs to annotate.

cat

a VCF object with the SV catalog with frequency estimates.

min.ol

the minimum overlap/coverage to be considered a match. Default is 0.5

min.del.rol

minimum reciprocal overlap for deletions. Default is 0.1

max.ins.dist

maximum distance for insertions to be clustered. Default is 20.

check.inv

should the sequence of MNV be compared to identify inversions.

range.seq.comp

compare sequence instead of only overlapping deletions/inversions/etc. Default is FALSE.

ins.seq.comp

compare sequence instead of insertion sizes. Default is FALSE.

out.vcf

If non-NULL, write output to this VCF file.

freq.field

the field with the frequency estimate in the 'cat' input. Default is 'AF'.

out.freq.field

the new field's name. Default is 'AFMAX'

method

the method to annotate the overlap. Recommended is 'reciprocal' (default). See details.

nb.cores

number of processors to use. Default is 1.

log.level

the level of information in the log. Default is "CRITICAL" (basically no log).

Value

a GRanges object.

Author(s)

Jean Monlong

Examples

## Not run: 
## From VCF files with output written to VCF file
freqAnnotate('calls.vcf', 'gnomad.vcf', out.vcf='calls.withFreq.vcf')

## Within R
calls.vcf = readSVvcf('calls.vcf', out.fmt="vcf")
cat.vcf = readSVvcf('gnomad.vcf', out.fmt="vcf")
calls.freq.vcf = freqAnnotate(calls.vcf, cat.vcf)

## End(Not run)

jmonlong/sveval documentation built on July 31, 2023, 7:50 p.m.