Retrieve genomic ranges for variant sets.

getRanges(
  object,
  gdb,
  output = NULL,
  table = "var",
  CHROM = "CHROM",
  POS = "POS",
  where = c()
)

Arguments

object

Input varSetFile or varSetList.

gdb

A gdb object.

output

Output file path. Output will be gz-compressed. Defaults to NULL, in which case ranges are returned as a data.frame.

table

Name of lookup table for extracting variant positions. Defaults to "var".

CHROM

If the name of the column in table that specifies the chromosome is not named CHROM, the column name can be specified here.

POS

If the name of the column in table that specifies variant position is not named POS, the column name can be specified here.

where

An SQL compliant where clause to filter output; eg: "CHROM=2 AND POS between 5000 AND 50000 AND AF<0.01 AND (cadd.caddPhred>15 OR snpEff.SIFT='D')". Can be either of length 1, in which case the same where clause is applied for each varSet, or of length equal to the number of varSets in the provided varSetList or varSetFile, in which case each where clause is applied to the corresponding varSet.

Details

This function method retrieves genomic ranges (chromosome, start, and end positions) for variant sets defined in a varSetFile or varSetList. It will map positions based on a variant annotations table in provided gdb (default = "var").

Examples


library(rvatData)
varsetfile <- varSetFile(rvat_example("rvatData_varsetfile.txt.gz"))
gdb <- create_example_gdb()
ranges <- getRanges(varsetfile, gdb = gdb)