Whop_readVCF: Reading tabixed VCF files (an interface to WhopGenome)

Description Usage Arguments Details Value Examples

View source: R/Whop_readVCF.R

Description

This function provides an interface to the WhopGenome package which is specialized to read tabix-indexed VCF files.

Usage

1
2
Whop_readVCF(v, numcols, tid, frompos, topos,
        samplenames=NA, gffpath = FALSE, include.unknown=FALSE)

Arguments

v

a vcf_handle returned from vcf_open()

numcols

number of SNPs that should be read in as one chunk

tid

which chromosome ? (character)

frompos

start of the region

topos

end of the region

samplenames

a vector of individual names/IDs

gffpath

the corresponding GFF file

include.unknown

including positions with unknown nucleotides

Details

WhopGenome is required ! require(WhopGenome) WhopGenome provides some powerful filter meachanisms which can be applied to the VCF reading process. The filter rules can be set via WhopGenome functions. Whop_readVCF expects a vcf_handle returned from vcf_open. The Whop_readVCF function expects a tabixed VCF with a diploid GT-field.
In case of haploid data, the GT-field has to be transformed to a pseudo- diploid field (0 -> 0|0 etc.). An alternative is to use readData(..., format="VCFhap") which can read non-tabixed haploid VCFs directly.
The ff-package we use limits the data size to individuals * (number of SNPs) <= .Machine$integer.max
In case of very large data sets, the bigmemory package will be used.
This may slow down calculations.
See also readData(..., format="VCF") !

Value

The function creates an object of class "GENOME"

———————————————————
The following slots will be filled in the "GENOME" object
———————————————————

Slot Description
1. n.sites total number of sites
2. n.biallelic.sites number of biallelic sites
3. region.data some detailed information on the data read
4. region.names names of regions

Examples

1
2
3
4
5
# require(WhopGenome)
# vcf_handle   <- vcf_open("chr2.vcf.gz")
# GENOME.class <- Whop_readVCF(vcf_handle, 1000, "2", 1, 100000)
# GENOME.class
# GENOME.class@region.names

PopGenome documentation built on Feb. 1, 2020, 1:07 a.m.