vcf_to_mutations_df: Helper function to read a vcf into the required format of...

Description Usage Arguments Examples

View source: R/vcf_to_mutations_df.R

Description

Uses VariantAnnotation::readVcfAsVRanges to read the vcf file, which return variants in a format that each row is one variant. If the vcf has multiple samples, the samples will be appended by rows. Provide a sample_name to return only the variants belonging to the sample of interest. Once you use this function, make sure that all the variants are relevant. The function will only return SNVs.

Usage

1
vcf_to_mutations_df(vcf, sample_name = NULL, ...)

Arguments

vcf

the path to vcf file

sample_name

a character(1) when provided, return only variants from this sample

...

other options passed to VariantAnnotation::readVcfAsVRanges

Examples

1
2
vcf <- system.file("extdata", "chr22.vcf.gz", package="VariantAnnotation")
vcf_to_mutations_df(vcf, sample_name = "HG00096")

ctDNAtools documentation built on March 26, 2020, 7:39 p.m.