getRead: Get read count data.

getReadR Documentation

Get read count data.

Description

Read counts for reference allele and alternative allele are retrieved from the GDS file linked to the given GbsrGenotypeData object.

Usage

getRead(object, node = "raw", parents = FALSE, valid = TRUE, chr = NULL, ...)

## S4 method for signature 'GbsrGenotypeData'
getRead(object, node, parents, valid, chr)

Arguments

object

A GbsrGenotypeData object.

node

Either of "raw" and "filt". See details.

parents

A logical value or "only" whether to include data for parents or not or to get data only for parents.

valid

A logical value. See details.

chr

An integer vector of indexes indicating chromosomes to get read count data.

...

Unused.

Details

When ⁠node = "raw⁠, the raw read counts stored in the "annotation/format/AD/data" node will be returned, while ⁠node = "filt⁠ make the function to return the filtered read counts stored in the "annotation/format/FAD/data" that can be generated via the setCallFilter() function. If valid = TRUE, read counts for only valid marker and valid samples will be obtained.

Value

A named list with two elements "ref" and "alt" storing a matrix of reference allele read counts and a matrix of alternative read counts for all markers in all samples.

See Also

setCallFilter()

Examples

# Load data in the GDS file and instantiate a [GbsrGenotypeData] object.
gds_fn <- system.file("extdata", "sample.gds", package = "GBScleanR")
gds <- loadGDS(gds_fn)

read <- getRead(gds)

# Close the connection to the GDS file.
closeGDS(gds)


tomoyukif/GBScleanR documentation built on March 12, 2024, 6:27 a.m.