Usage
## S3 method for class 'ANY,GRanges,missing':
genotypeMatrix(Z, pos, seqnames,
ploidy=2, na.string=NULL, na.limit=1, MAF.limit=1,
na.action=c("impute.major", "omit", "fail"),
MAF.action=c("invert", "omit", "ignore", "fail"),
sex=NULL)
## S3 method for class 'ANY,numeric,character':
genotypeMatrix(Z, pos, seqnames, ...)
## S3 method for class 'ANY,character,missing':
genotypeMatrix(Z, pos, seqnames, ...)
## S3 method for class 'ANY,missing,missing':
genotypeMatrix(Z, pos, seqnames, subset,
noIndels=TRUE, onlyPass=TRUE, sex=NULL, ...)
## S3 method for class 'eSet,numeric,character':
genotypeMatrix(Z, pos, seqnames, ...)
## S3 method for class 'eSet,character,missing':
genotypeMatrix(Z, pos, seqnames, ...)
## S3 method for class 'eSet,character,character':
genotypeMatrix(Z, pos, seqnames, ...)
Arguments
Z
an object of class dgCMatrix
, a numeric
matrix, a character matrix, an object of class
VCF
, or an object of class eSet
(see details below) pos
an object of class GRanges
, a numeric
vector, or a character vector (see details below)
seqnames
a character vector (see details below)
ploidy
determines the ploidy of the genome for the computation of
minor allele frequencies (MAFs) and the possible inversion of
columns with an MAF exceeding
0.5; the elements of Z
may not exceed this value.
subset
a numeric vector with indices or a character vector with
names of samples to restrict to
na.limit
all columns with a missing value ratio above this
threshold will be omitted from the output object.
MAF.limit
all columns with an MAF above this
threshold will be omitted from the output object.
na.action
if impute.major, all missing values will
be imputed by major alleles in the output object. If
omit, all columns containing missing values will be
omitted in the output object. If fail, the function stops
with an error if Z
contains any missing values.
MAF.action
if invert, all columns with an MAF
exceeding 0.5 will be inverted in the sense that all minor alleles
will be replaced by major alleles and vice versa. For numerical
Z
, this is accomplished by subtracting the column from the
ploidy value. If omit, all columns with an MAF greater
than 0.5 are omitted in the output object. If ignore,
no action is taken and MAFs greater than 0.5 are kept as they are.
If fail, the function stops with an error if Z
contains any column with an MAF greater than 0.5.
noIndels
if TRUE
(default), only single nucleotide
variants (SNVs) are considered
and indels are skipped; only works if the ALT
column is
present in the VCF
object Z
, otherwise a
warning is shown and the noIndels
argument is ignored.
onlyPass
if TRUE
(default), only variants are considered
whose value in the FILTER
column is PASS;
only works if the FILTER
column is
present in the VCF
object Z
, otherwise a
warning is shown and the onlyPass
argument is ignored.
na.string
if not NULL
, all . entries in the character
matrix or VCF
genotype are replaced with this
string before parsing the matrix.
sex
if NULL
, all rows of Z
are treated the same
without any modifications; if sex
is a factor with levels
F
(female) and M
(male) that is as long as
Z
has rows, this argument is interpreted as the sex of the
samples. In this case, the rows corresponding to male samples are
doubled before further processing. This is designed for mixed-sex
analyses of the X chromosome outside of the pseudoautosomal
regions.
...
all additional arguments are passed on internally to the
genotypeMatrix
method with signature ANY,GRanges,missing
.