load_vcf | R Documentation |
This function parses a set of mutations in the Variant Calling
Format (VCF), using the vcfR
R package. The function takes
in input the column names of the INFO field referring to
allele depth counts, and number of reads with the variant. The
two columns are used to compute the variant allele frequency (VAF)
value; if any of the required columns are not found, an error
is returned. This function does not filter any of the variants
annotated in the input VCF file.
load_vcf(file, DP_column = "DP", NV_column = "NV")
file |
A VCF file name. |
DP_column |
Column with the total depth (DP), i.e., sum of reads at a locus. |
NV_column |
Column with the number of reads with the variant (NV). |
A tibble with the loaded data which contains, besides all the content parsable from the VCF file, three columns named DP, NV and VAF where VAF = NV/DP.
# Example VCF file in the https://github.com/openvax/varcode repository
file = 'https://raw.githubusercontent.com/openvax/varcode/master/test/data/strelka-example.vcf'
download.file(url = file, destfile = 'strelka-example.vcf')
# We pretend that the number of variants is the gt_DP2 field, which is wrong
# Anyway, this shows how you can load a VCF file.
load_vcf(file = 'strelka-example.vcf', DP_column = 'gt_DP', NV_column = 'gt_DP2')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.