vcf_countSNPs: Count how many entries in the selected region

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/read_simple.R

Description

Reads all data in the currently selected region of the given VCF file and counts how many loci with SNPs or biallelics SNPs respectively, are encountered.

Usage

1
2

Arguments

vcffh

Handle to a VCF file, as returned by vcf_open

Details

For certain cases, like pre-allocating variables, it can be useful to know how many SNPs are present in a certain region. In order to reduce the effort of this task and its impact on runtime to a minimum, the functions vcf_countSNPs and vcf_countBiallelicSNPs were implemented. Take note that they do not automatically 'restart' from the beginning of the selected region but continue from the current position. Use vcf_restartregion to make sure that all SNPs in the currently set region are counted.

Value

An integer number is returned: the number of SNPs or biallelic SNPs.

Author(s)

Ulrich Wittelsbuerger

See Also

vcf_restartregion

Examples

1
2
3
4
5
6
7
8
	##
	##	Example:
	##
	vcffile <- system.file( "extdata" , "ex.vcf.gz" , package="WhopGenome" )
	vcffile
	vcffh <- vcf_open( vcffile )
	vcffh
	vcf_countSNPs( vcffh )

WhopGenome documentation built on May 1, 2019, 10:12 p.m.