GDSArray-classes: GDSArray constructor and coercion methods.

extract_arrayR Documentation

GDSArray constructor and coercion methods.

Description

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

GDSArray: The function to convert a gds file into the GDSArray data structure.

GDSArray example data

Usage

## S4 method for signature 'GDSArraySeed'
extract_array(x, index)

GDSArray(gdsfile, varname)

gdsExampleFileName(type = c("seqgds", "snpgds"))

Arguments

x

the GDSArraySeed object

index

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.

gdsfile

Can be a GDSArraySeed, a character string of gds file name, or an "gds.class" R object.

varname

A character string specifying the gds array node to be read into GDSArray.

type

the type of gds file, available are "seqgds" for SeqVarGDSClass and "snpgds" for SNPGDSFileClass.

Value

GDSArray class object.

Examples

fn <- gdsExampleFileName("snpgds") 
allnodes <- gdsnodes(fn)  ## print all available gds nodes in fn.
allnodes
GDSArray(fn, "genotype")
GDSArray(fn, "sample.annot/pop.group")

fn1 <- gdsExampleFileName("seqgds")
allnodes1 <- gdsnodes(fn1)  ## print all available gds nodes in fn1. 
allnodes1
## GDSArray(fn1, "genotype/data")
GDSArray(fn1, "variant.id")
GDSArray(fn1, "sample.annotation/family")
GDSArray(fn1, "annotation/format/DP/data")
GDSArray(fn1, "annotation/info/DP")
gdsExampleFileName("snpgds")
gdsExampleFileName("seqgds")

Bioconductor/GDSArray documentation built on May 5, 2024, 9:32 a.m.