read_vcf: Convert a VCF file of genomics segments into a 'data.table'

Description Usage Arguments Details Value Examples

View source: R/read_VCF.R

Description

read_vcf read a VCF file into a data.table

Usage

1
2
3
4
5
6
7
read_vcf(
  DT_path,
  end_vcf = "END",
  CN_vcf = "CN",
  samples = NA,
  explore = FALSE
)

Arguments

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, FALSE by default. If TRUE the file in DT_path is not loaded, instead, several info about the VCF fields are printed.

Details

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.

Value

a CNVresults from the VCF results conversion.

Examples

1
2
3
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)

SinomeM/CNVgears documentation built on Nov. 21, 2021, 5:34 a.m.