ReadVCF: Read in the data lines of a Variant Call Format (VCF) file

View source: R/VCF_to_catalog_functions.R

ReadVCFR Documentation

Read in the data lines of a Variant Call Format (VCF) file

Description

Read in the data lines of a Variant Call Format (VCF) file

Usage

ReadVCF(
  file,
  variant.caller = "unknown",
  name.of.VCF = NULL,
  tumor.col.name = NA,
  filter.status = DefaultFilterStatus(variant.caller),
  get.vaf.function = NULL,
  ...
)

Arguments

file

The name/path of the VCF file, or a complete URL.

variant.caller

Name of the variant caller that produces the VCF, can be either "strelka", "mutect", "freebayes" or "unknown". This information is needed to calculate the VAFs (variant allele frequencies). If "unknown"(default) and get.vaf.function is NULL, then VAF and read depth will be NAs.

name.of.VCF

Name of the VCF file. If NULL(default), this function will remove all of the path up to and including the last path separator (if any) in file and file path without extensions (and the leading dot) will be used as the name of the VCF file.

tumor.col.name

Optional. Only applicable to Mutect VCF. Name or index of the column in Mutect VCF which contains the tumor sample information. It must have quotation marks if specifying the column name. If tumor.col.name is equal to NA(default), this function will use the 10th column to calculate VAFs. See GetMutectVAF for more details.

filter.status

The character string in column FILTER of the VCF that indicates that a variant has passed all the variant caller's filters. Variants (lines in the VCF) for which the value in column FILTER does not equal filter.status are silently excluded from the output. The internal function DefaultFilterStatus tries to infer filter.status based on variant.caller. If variant.caller is "unknown", user must specify filter.status explicitly. If filter.status = NULL, all variants are retained. If there is no FILTER column in the VCF, all variants are retained with a warning.

get.vaf.function

Optional. Only applicable when variant.caller is "unknown". Function to calculate VAF(variant allele frequency) and read depth information from original VCF. See GetMutectVAF as an example. If NULL(default) and variant.caller is "unknown", then VAF and read depth will be NAs.

...

Optional arguments to get.vaf.function.

Value

A data frame storing data lines of the VCF file with two additional columns added which contain the VAF(variant allele frequency) and read depth information.


ICAMS documentation built on June 15, 2025, 1:08 a.m.