Learn R Programming

WhopGenome (version 0.9.4)

vcf_rule.setcomparison: Set comparison operation for filtering rule.

Description

For filtering rule the comparison operation is set to , which is one of the following strings: string: alternative: meaning: ------- ------------ -------- "HASKEY" "DOES_EXIST" key (specified as field) is present in column - integer comparisons: "INT=" "INT_CMP" ref1 = value "INT()" "INT_CMP_OO" ref1 < value < ref2 "INT(]" "INT_CMP_OC" ref1 < value

Usage

vcf_rule.setcomparison( vcffh, ruleidx, cmpop )

Arguments

vcffh
VCF file handle
ruleidx
number of rule in list
cmpop
One of the above strings, naming the comparison operation to perform

Value

TRUE on success, FALSE if it failed.

Details

Certain VCF read functions support the fast pre-filtering mechanism of WhopGenome. The pre-filtering mechanism is a list of rules that describe how and what to check in SNP descriptions and is executed very quickly without using any R code. Every rule specifies the column of data (e.g. INFO, POS, FILTER), the key in the column (e.g. AF in the INFO column), the type of comparison , reference values to compare against and whether to keep or drop the line if the rule matches.

Examples

Run this code
	##
	##	Example:
	##
	vcffile <- vcf_open( system.file( "extdata" , "ex.vcf.gz" , package="WhopGenome" ) )
	vcf_addfilter( vcffile, "POS", "", "INT_CMP_OO",
					as.integer(49005), as.integer(49007), "DROP" )
	vcf_describefilters( vcffile )
	
	vcf_rule.setcomparison( vcffile , 0, "INT_CMP_CC" )
	vcf_describefilters( vcffile )

Run the code above in your browser using DataLab