Description Usage Arguments Details Value Accessor methods Author(s) See Also Examples
The Genotypes
class stores genotype definitions in a convenient format.
1 2 3 | Genotypes(
ref = NA_character_, het = NA_character_, alt = NA_character_,
suffix = c(ref="REF", het="HET", alt="ALT"))
|
ref |
A |
het |
A |
alt |
A |
suffix |
Set the individual INFO key suffixes used to store the statistics of homozygote reference, heterozygote, and homozygote alternate genotypes, in this order. See Details section. |
Genotypes may be initialised as NA_character_
and updated from an
imported VCF
object using the
autodetectGenotypes
method.
This may be useful if genotype encodings are not known beforehand.
For each suffix stored in the Genotypes
object, TVTB
may store data in the VCF
object under the INFO keys defined as follows:
Statistics across all samples in the ExpandedVCF
(e.g. "MAF").
Statistics across samples associated with a given level of a given phenotype (e.g. "gender_male_MAF").
Users are recommended to avoid using those INFO keys for other purposes.
A Genotypes
object that contains genotype definitions.
In the following code snippets x
is a Genotypes
object.
ref(x)
, ref(x) <- value
Gets or sets the vector that declares homozygote reference genotypes.
het(x)
, het(x) <- value
Gets or sets the vector that declares heterozygote genotypes.
alt(x)
, alt(x) <- value
Gets or sets the vector that declares homozygote alternate genotypes.
genos(x)
Gets a vector of concatenated
homozygote reference, heterozygote, and homozygote alternate genotypes.
See also ref
, het
, alt
, and carrier
accessors.
carrier(x)
Gets a vector of concatenated
heterozygote and homozygote alternate genotypes.
See also het
and alt
accessors.
suffix(x)
Gets a named character
vector that declares individual suffixes
used to store the data for each set of genotypes in the INFO field of the
VCF
object.
Names of this vector are ref
, het
, and alt
.
Kevin Rue-Albrecht
VCF
,
TVTBparam
,
and addCountGenos-methods
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # Constructors ----
genotypes <- Genotypes("0|0", c("0|1", "1|0"), "1|1")
# Accessors ----
## Concatenated homozygote reference, heterozygote, and alternate heterozygote
## genotypes stored in the Genotypes object returned by the genos() accessor.
genos(genotypes)
## Individual genotypes can be extracted with ref(), het(), alt() accessors.
ref(genotypes)
het(genotypes)
alt(genotypes)
## Their individual INFO key suffixes can be extracted with suffix() accessors
## and the relevant name
suffix(genotypes)
suffix(genotypes)["ref"]
suffix(genotypes)["het"]
suffix(genotypes)["alt"]
## Concatenated heterozygote, and alternate heterozygote genotypes are
## returned by the carrier() accessor.
carrier(genotypes)
names(carrier(genotypes))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.