VCFArray-classes: VCFArray constructor and coercion methods.

Description Usage Arguments Value Examples

Description

extract_array: the function to extract data from a VCF file, by taking VCFArraySeed as input. This function is required by the DelayedArray for the seed contract.

VCFArray: The function to convert data entries inside VCF file into the VCFArray instance.

Usage

1
2
3
4
## S4 method for signature 'VCFArraySeed'
extract_array(x, index)

VCFArray(file, vindex = character(), name = NA)

Arguments

x

the VCFArraySeed object

index

in extract_array(), an unnamed list of subscripts as positive integer vectors, one vector per dimension in x. Empty and missing subscripts (represented by integer(0) and NULL list elements, respectively) are allowed. The subscripts can contain duplicated indices. They cannot contain NAs or non-positive values.

file

takes values for charater string (specifying the VCF file path), VcfFile object, and RangedVcfStack object.

vindex

in VCFArray(), the character string specifying the index file path. This argument is required if an remote VCF file is used for the file argument.

name

the data entry from VCF file to be read into VCFArraySeed / VCFArray. For VCFArray. This argument should always be specified.

Value

VCFArray class object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
fl <- system.file("extdata", "chr22.vcf.gz",
                  package="VariantAnnotation")
va <- VCFArray(fl, name = "GT")
va
vcf <- VariantAnnotation::VcfFile(fl)
va1 <- VCFArray(vcf, name = "GT")
va1
all.equal(va, va1)

## RangedVcfStack class
library(GenomicFiles)
rgstackFile <- system.file("extdata", "rgstack.rds", package = "VCFArray")
rgstack <- readRDS(rgstackFile)
va2 <- VCFArray(rgstack, name = "SB")
va2
## coercion
as(va[1:10, ], "array")

Liubuntu/VCFArray documentation built on May 7, 2019, 7:40 a.m.