subvcf: Subset of VCF data

Description Usage Arguments Value Author(s) See Also Examples

View source: R/filtervcf.R

Description

To obtain a subset of a vcf object data.

Usage

1
2
subvcf(vcf, CHR = NULL, POS = NULL, CHRPOS=NULL, samples = NULL, TF =
NULL)

Arguments

vcf

A vcf object data.

CHR

Chromosome. To get the subset of input vcf data based on specified chromosome(s).

POS

Position. To get the subset of input vcf data based on specified positions.

CHRPOS

Position within a chromosome separated by colon.

samples

To specify sample(s) of interest.

TF

A vector of logical values. To define which of the corresponding positions will be extracted.

Value

A vcf object returned.

Author(s)

Qiang Hu

See Also

filtervcf

Examples

1
2
3
4
5
6
7
8
9
vcffile <- system.file("extdata", "1151HZ0001.flt.vcf", package="VPA")
vcfdata <- read.vcf(vcffile)

#extract calls in position 1:985999
subvcf(vcfdata, CHRPOS="1:985999")

#extract calls by TF
tf <- c(rep(TRUE, 10), rep(FALSE, length(vcfdata$POS)-10))
subvcf(vcfdata, TF=tf)

VPA documentation built on May 2, 2019, 4:45 p.m.