read_vcf function

VCF Data Input

VCF Data Input

Reads a file in vcf or vcf.gz file and creates a list containing Content, Meta, VCF and file_sample_name

read_vcf(fn, vcffor, dbOnly = FALSE, depCut = FALSE, thred = 20, metaline = 200, extnum = 10, keepall = T)

Arguments

  • fn: Input vcf file name
  • vcffor: Input vcf data format: 1) GATK; 2) VarPROWL; 3) VarDict; 4) strelka2
  • dbOnly: Use dbSNP as filter, default is FALSE
  • depCut: Use a threshold for min depth , default is False
  • thred: Threshold for min depth, default is 20
  • metaline: Number of head lines to read in (better to be large enough), the lines will be checked if they contain meta information, default is 200
  • extnum: The column number to be extracted from vcf, default is 10; 0 for not extracting any column; extnum should be between 10 and total column number
  • keepall: Keep unextracted column in output, default is TRUE

Returns

A list containing (1) Content: a vector showing what is contained; (2) Meta: a data frame containing meta-information of the file; (3) VCF: a data frame, the main part of VCF file; (4) file_sample_name: the file name and sample name, in case when multiple samples exist in one file, file and sample names might be different

Examples

file.name <- system.file("extdata", "example.vcf.gz", package = "sssc") example <- read_vcf(fn=file.name, vcffor="VarPROWL")
  • Maintainer: Tao Jiang
  • License: GPL-2
  • Last published: 2018-06-15

Useful links