read_vcf {CNVgears} | R Documentation |
data.table
read_vcf
read a VCF file into a data.table
read_vcf( DT_path, end_vcf = "END", CN_vcf = "CN", samples = NA, explore = FALSE )
DT_path |
path to the file. |
end_vcf |
name of the field containing the segment end information. |
CN_vcf |
name of the field containing the segment copy number information. |
samples |
NA by default, if a character vector is provided is used to identify and select samples in a VCF containing multiple ones. |
explore |
logic, |
This function use readVcf
from VariantAnnotation
to read VCF
files, then it select only the necessary columns (for the purpose of CNVs
calling results analysis) and convert it to a data.table
. Can also be
used to check the names of the necessary fields (end and copy number) if not
already known, using the parameter explore
. By default it expect a
file containing data for a single sample (e.g. the results of gCNV from
GATK), but it can process files containing multiple samples if a character
vector containing the IDs is given to the parameter samples
.
a CNVresults
from the VCF results conversion.
read_vcf(DT_path = system.file("extdata", "VCF_res_example.vcf", package = "CNVgears")) read_vcf(DT_path = system.file("extdata", "VCF_res_example.vcf", package = "CNVgears"), explore = TRUE)