Description Usage Arguments Details Value Author(s) Examples
Add a condition for filtering SNPs based on any column in a given VCF file.
1 | vcf_addfilter(vcf, columnnam, fieldnam, cmptype, cmpvalue1, cmpvalue2 = 0, action)
|
vcf |
VCF file handle |
columnnam |
name of column containing the to-be-checked values |
fieldnam |
name of the subfield or "" to check |
cmptype |
Type of comparison to perform. See Details |
cmpvalue1 |
Comparison reference value 1 or lower bound |
cmpvalue2 |
Comparison reference value 2 or upper bound |
action |
Action to take if comparison matches : NOP, SKIP, KEEP or fails: SKIP_NOT, KEEP_NOT |
Parameter 'columnnam': Name of a VCF column, in which the data of interest is stored Parameter 'fieldnam': For the INFO and samples columns, the key under which the interesting data is stored. Example: vcf_addfilter( vcffile , "INFO", "H2", "DOES_EXIST", 0, 0, "DROP_NOT" ) would cause any subsequent calls to read functions that perform filtering to drop lines that do not have the "H2" key in the INFO column, which indicates that the SNP is not marked as being registered in HapMap2. The parameters <ref1> and <ref2> are not used by the "DOES_EXIST" operation.
Comparison types:
DOES_EXIST Rule matches, if in column named by <columnnam> is a key with the same name as in <fieldnam>
for integer values:
INT_CMP is value = ref1 ?
INT_CMP_OO is value in open range (ref1, ref2)
INT_CMP_OC is value in half-closed range (ref1, ref2]
INT_CMP_CO is value in half-closed range [ref1, ref2)
INT_CMP_CC is value in closed range [ref1, ref2]
for floating point values:
FLT_CMP is value = ref1 ?
FLT_CMP_OO is value in open range (ref1, ref2)
FLT_CMP_OC is value in half-closed range (ref1, ref2]
FLT_CMP_CO is value in half-closed range [ref1, ref2)
FLT_CMP_CC is value in closed range [ref1, ref2]
Success status: TRUE on success, FALSE if the rule could not be added.
Ulrich Wittelsbuerger
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ##
## Example:
##
vcffile <- vcf_open( system.file( "extdata" , "ex.vcf.gz" , package="WhopGenome" ) )
vcf_setregion(vcffile, "Y", 1, 100000 )
vcf_addfilter( vcffile, "POS", "", "INT_CMP_OO",
as.integer(49005), as.integer(49007), "DROP" )
vcf_describefilters( vcffile )
####
####
vcf_readLineVecFiltered( vcffile )
vcf_readLineVecFiltered( vcffile )
vcf_readLineVecFiltered( vcffile )
#######
#######
vcf_clearfilters( vcffile )
vcf_describefilters( vcffile )
vcf_restartregion( vcffile )
####
####
vcf_readLineVecFiltered( vcffile )
vcf_readLineVecFiltered( vcffile )
vcf_readLineVecFiltered( vcffile )
##
##
vcf_close( vcffile )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.