Objects of this class store microsatellite datasets in which allele copy
number is ambiguous. Genotypes are stored as a two-dimensional list of
vectors, each vector containing all unique alleles for a given sample at
a given locus. genambig
is a subclass of gendata
.
Objects can be created by calls of the form new("genambig",
samples, loci, ...)
. This automatically sets up a two-dimensional
list in the Genotypes
slot, with dimnames=list(samples,
loci)
. This array-list is initially populated with the missing data
symbol. All other slots are given initial values according to the
initialize
method for gendata
. Data can then be inserted
into the slots using the replacement functions (see
Accessors
).
Genotypes
:Object of class "array"
. The first
dimension of the array represents and is named by samples, while
the second dimension represents and is named by loci. Each
element of the array can contain a vector. Each vector should
contain each unique allele for the genotype once. If an array
element contains a vector of length 1 containing only the symbol
that is in the Missing
slot, this indicates missing data
for that sample and locus.
Description
:Object of class "character"
. This
stores a description of the dataset for the user's convenience.
Missing
:Object of class "ANY"
. A symbol to be
used to indicate missing data in the Genotypes
slot. This is
the integer -9
by default.
Usatnts
:Object of class "integer"
. A vector,
named by loci. Each element indicates the repeat type of the
locus. 2
indicates dinucleotide repeats, 3
indicates trinucleotide repeats, and so on. If the alleles stored
in the Genotypes
slot for a given locus are already written
in terms of repeat number, the Usatnts
value for that locus
should be 1
. In other words, all alleles for a locus can be
divided by the number in Usatnts
to give alleles expressed in
terms of relative repeat number.
Ploidies
:Object of class "integer"
. A vector,
named by samples. This stores the ploidy of each sample. NA
indicates unknown ploidy. See Ploidies<-
and
estimatePloidy
for ways to fill this slot.
PopInfo
:Object of class "integer"
. A vector,
named by samples, containing the population identity of each sample.
PopNames
:Object of class "character"
. A
vector containing names for all populations. The position of a
population name in the vector indicates the integer used to
represent that population in PopInfo
.
Class "gendata"
, directly.
For more information on any of these methods, see the help files of their respective generic functions.
signature(object = "genambig")
: Removes
columns in the array in the Genotypes
slot corresponding to
the locus names supplied, then passes the arguments to the method
for gendata
.
signature(object = "genambig")
: Removes
rows in the array in the Genotypes
slot corresponding to
the sample names supplied, then passes the arguments to the method
for gendata
.
signature(object = "genambig")
: Each
vector in the Genotypes
slot is placed into the row of a
data frame, along with the sample and locus name for this vector.
The data frame is then opened in the Data Editor so that the user
can make changes. When the Data Editor window is closed, vectors
are extracted back out of the data frame and written to the
Genotypes
slot.
signature(object = "genambig")
:
Calculates the length of each genotype vector (excluding those
with the missing data symbol), and creates a data frame showing
the maximum and mean number of alleles per locus for each sample.
This data frame is then opened in the Data Editor, where the user
may edit ploidy levels. Once the Data Editor is closed, the
genambig
object is returned with the new values written to
the Ploidies
slot.
signature(object = "genambig")
: Retrieves a
single genotype vector, as specified by sample
and
locus
arguments.
signature(object = "genambig")
: Replaces a
single genotype vector.
signature(object = "genambig")
: Retrieves a
two-dimensional list of genotype vectors.
signature(object = "genambig")
: Replaces a
one- or two-dimensional list of genotype vectors.
signature(.Object = "genambig")
: When
new
is called to create a new genambig
object, the
initialize
method sets up a two dimensional list in the
Genotypes
slot indexed by sample and locus, and fills this
list with the missing data symbol. The initialize
method
for gendata
is then called.
signature(object = "genambig")
: Given a set of
samples and loci, each position in the array in the Genotypes
slot is checked to see if it matches the missing data value. A single
Boolean value or an array of Boolean values is returned.
signature(object = "genambig")
: For changing
the names of loci. The names are changed in the second dimension
of the array in the Genotypes
slot, and then the
Loci<-
method for gendata
is called.
signature(object = "genambig")
: For changing
the missing data symbol. All elements of the Genotypes
array
that match the current missing data symbol are changed to the new
missing data symbol. The Missing<-
method for gendata
is then called.
signature(object = "genambig")
: For changing
the names of samples. The names are changed in the first dimension
of the array in the Genotypes
slot, and then the
Samples<-
method for gendata
is called.
signature(object = "genambig")
: Prints the
dataset description (Description
slot) to the console as
well as the number of missing genotypes, then calls the
summary
method for gendata
.
signature(object = "genambig")
: Prints the
data to the console, formatted to make it more legible. The
genotype for each locus is shown as the size of each allele,
separated by a '/'. The SSR motif length ('Usatnts'), ploidies,
population names, and population membership ('PopInfo') are
displayed if they exist.
signature(object = "genambig")
: Prints a
tab-delimited table of samples, loci, and genotype vectors to the console.
signature(x = "genambig", i = "ANY", j = "ANY")
:
For subscipting genambig
objects. Should be of the form
mygenambig[mysamples, myloci]
. Returns a genambig
object. The Genotypes
slot
is replaced by one containing only samples i
and loci
j
. Likewise, the PopInfo
and Ploidies
slots
are truncated to contain only samples i
, and the
Usatnts
slot is truncated to contain only loci
j
. Other slots are left unaltered.
signature(x = "genambig", y = "genambig")
:
Merges two genotypes objects together. See
merge,genambig,genambig-method
.
Lindsay V. Clark, Tyler W. Smith
gendata
, Accessors
,
merge,genambig,genambig-method
# display class definition
showClass("genambig")
# create a genambig object
mygen <- new("genambig", samples=c("a", "b", "c", "d"),
loci=c("L1", "L2", "L3"))
# add some genotypes
Genotypes(mygen)[,"L1"] <- list(c(133, 139, 145), c(142, 154),
c(130, 142, 148), Missing(mygen))
Genotypes(mygen, loci="L2") <- list(c(105, 109, 113), c(111, 117),
c(103, 115), c(105, 109, 113))
Genotypes(mygen, loci="L3") <- list(c(254, 258), Missing(mygen),
c(246, 250, 262), c(250, 258))
# see a summary of the object
summary(mygen)
# display some of the genotypes
viewGenotypes(mygen[c("a", "b", "c"),])
Run the code above in your browser using DataLab