Skip to contents

summarize the various variant types at both variant level and sample level.

Usage

vcfsummary(
  vcffile,
  region = "",
  samples = "-",
  pass = FALSE,
  qual = 0,
  svtype = FALSE
)

Arguments

vcffile

path to the VCF/BCF file

region

region to subset like bcftools

samples

samples to subset like bcftools

pass

restrict to variants with FILTER==PASS

qual

restrict to variants with QUAL > qual.

svtype

summarize the variants with SVTYPE

Value

vcfsummary a list containing the following components:

summary

: named integer vector;
summarize the counts of each variant type

samples

: character vector;
the samples ids in the VCF file after subsetting

vartype

: integer vector;
the counts of the variant type at sample level in the same order as samples

Details

bcftools view -s "id01,id02" input.bcf.gz chr1:100000-20000

Author

Zilong Li zilong.dk@gmail.com

Examples

library('vcfppR')
svfile <- system.file("extdata", "sv.vcf.gz", package="vcfppR")
res <- vcfsummary(svfile, region = "chr21:1-10000000", svtype = TRUE)
str(res)