getGenotype: Get genotype call data.

getGenotypeR Documentation

Get genotype call data.

Description

Genotype calls are retrieved from the GDS file linked to the given GbsrGenotypeData object.

Usage

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

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

Arguments

object

A GbsrGenotypeData object.

node

Either of "raw", "filt", "cor", and "parents". See details.

parents

A logical value or "only" whether to include data for parents or not or to get data only for parents. Ignored if ⁠node = "parents⁠.

valid

A logical value. See details.

chr

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

phased

If set TRUE to phased, the function will return phased genotype data in a P x N x M array where P, N, and M are the ploidy, number of samples, and number of markers.

...

Unused.

Details

When ⁠node = "raw⁠, the raw genotype data stored in the "genotype/data" node will be returned, while ⁠node = "filt⁠ make the function to return the filtered genotype data stored in the "annotation/format/FGT/data" that can be generated via the setCallFilter() function. ⁠node = "cor⁠ indicates to get the corrected genotype data stored in the "annotation/format/CGT/data" that can be generated via the estGeno() function. The estimated parental genotypes, which also can be generated via the estGeno() function and stored in the "annotation/info/PGT" node, can be obtained with node = "parents". If valid = TRUE, genotype calls for only valid marker and valid samples will be obtained.

Value

An integer matirix of genotype data which is represented by the number of reference alleles at each marker of each sample.

See Also

setCallFilter() and estGeno()

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)

geno <- getGenotype(gds)

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



tomoyukif/GBScleanR documentation built on June 12, 2024, 12:57 a.m.