GdsReader {GWASTools}R Documentation

Class GdsReader

Description

The GdsReader class provides an interface for reading GDS files.

Constructor

GdsReader(filename, allow.fork=FALSE):

filename must be the path to a GDS file or an already opened gds object.

allow.fork is a logical to enable multiple forks to access the gds file simultaneously.

The GdsReader constructor creates and returns a GdsReader instance pointing to this file.

Accessors

In the code snippets below, object is a GdsReader object.

getVariable(object, varname, start, count, sel=NULL, drop=TRUE): Returns the contents of the variable varname.

The result is a vector, matrix, or array, depending on the number of dimensions in the returned values and the value of drop. Missing values (specified by a "missing.value" attribute, see put.attr.gdsn) are represented as NA. If the variable is not found in the GDS file, returns NULL.

getVariableNames(object): Returns names of variables in the GDS file.

getDimension(object, varname): Returns dimension for GDS variable varname.

getNodeDescription(object, varname): Returns description for GDS variable varname.

getAttribute(object, attname, varname): Returns the attribute attname associated with the variable varname.

hasVariable(object, varname): Returns TRUE if varname is a variable in the GDS file.

Standard Generic Methods

In the code snippets below, object is a GdsReader object.

open(object): Opens a connection to a GDS file.

close(object): Closes the connection to a GDS file.

show(object): Summarizes the contents of a GDS file.

Author(s)

Stephanie Gogarten

See Also

gdsfmt

Examples

library(SNPRelate)
gds <- GdsReader(snpgdsExampleFileName())

getVariableNames(gds)

hasVariable(gds, "genotype")
geno <- getVariable(gds, "genotype", start=c(1,1), count=c(10,10))

close(gds)

[Package GWASTools version 1.38.0 Index]