filtervcf: Filter variants with user-specified quality criteria

Description Usage Arguments Value Author(s) See Also Examples

View source: R/filtervcf.R

Description

VCF format file contains various score to assess the positional-level quality of variant and sequence call. The function filtervcf can be used to filter variants with user-specified quality criteria.

Usage

1
2
filtervcf(vcf, alter = NULL, alter.PL=20, alter.AD=3, alter.ADP=NULL,
QUAL = 20, DP = c(10,500), GQ = NULL, FILTER = NULL, INDEL = NULL)

Arguments

vcf

A VCF object for filtering.

alter

Logical value. If TRUE, the variant positions are kept. If FALSE, the variant positions are discarded. If NULL, the option will be ignored.

alter.PL

Phred-scaled genotype likelihoods of variant call to define a variant. The PL information can be extracted from PL column (both GATK and Samtools) in the VCF data.

alter.AD

The minimum depth of variant allele when alter is TRUE. The information of variant allele depth can be extracted from AD (GATK) or DP4 (Samtools) column in the VCF data.

alter.ADP

The minimum percentage of read depth containing variant allele.

QUAL

phred-scaled variant likelihoods of variant call. The QUAL information can be extracted from QUAL column (both GATK and Samtools) in the VCF data.

DP

The minimum and maximum of position-level read depth. The DP information can be extracted from DP column (both GATK and Samtools) in the VCF data.

GQ

Phred-scaled score for most likely genotype at position of interest. The GQ information can be extracted from GQ column (both GATK and Samtools) in the VCF data. If NULL, the option will be ignored.

FILTER

'NULL' or 'PASS'. The VCF format of variant call produced by GATK will label quality status of each position. This information can be extracted from FILTER column (GATK) in the VCF data. If the VCF data is produced by Samtools, FILTER column will contain empty information. If 'NULL' is set, all variants will be parsed. If 'PASS' is set, only variant with 'PASS' label will be parsed.

INDEL

Logical value. If TRUE, only INDELs are evaluated. If FALSE, only point variants are evaluated. If NULL, the option will be ignored.

Value

The input vcf data will be filtered by user-specified quality criteria. A list including filtered vcf data and dropped vcf data will return.

Author(s)

Qiang Hu

See Also

subvcf

Examples

1
2
3
4
5
6
#Filter alignment artifacts to get promising SNP
#vcffile <- system.file("extdata", "1151HZ0001.flt.vcf", package="VPA")
#vcfdata <- read.vcf(vcffile)
#vcflt <- filtervcf(vcfdata, alter=TRUE, alter.AD=3, QUAL=20,
#DP=c(10,500), GQ=20, INDEL=FALSE)$filtered
#write.vcf(vcflt)

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