Learn R Programming

PopGenome (version 2.1.6)

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

Description

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

Usage

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

Value

  • The function creates an object of class "GENOME" --------------------------------------------------------- The following slots will be filled in the "GENOME" object --------------------------------------------------------- rll{ 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 }

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)

Examples

Run this code
# 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

Run the code above in your browser using DataLab