Description Usage Arguments Details Value Author(s) See Also Examples
Converts an object of class genalex
to a data frame in which the
genotype columns for each locus have been converted to genotypes
encoded with class genotype
as provided by the
genetics
package. All class genalex attributes are retained except for
class genalex
itself; see Details. Only conversion of diploid
data are supported, a inherent limitation of the
genetics
package.
1 2 3 | ## S3 method for class 'genalex'
as.genetics(x, phased = FALSE, sep = "/",
check.annotation = TRUE, ...)
|
x |
Annotated data frame of class |
phased |
Default |
sep |
Ignored, package |
check.annotation |
If |
... |
Additional arguments, currently ignored |
A class genotype
object is a special type
of factor, and in contrast to class genalex
a diploid genotype
is encoded as a single level of a factor and thus is in a single column
of a data frame. For diploid data, the number of columns in the resulting
data frame will be reduced by the number of loci. The sample name and
population columns are retained, as are the names of the loci.
If either allele of a genotype is missing, the entire genotype is treated
as missing in class genotype
.
This is a specialised wrapper around the functions
makeGenotypes
(phased = FALSE
) and
makeHaplotypes
(phased = TRUE
) from the
genetics
package.
x
as a data frame with the genotype of each locus encoded
using class genotype
. The class
genalex
is removed while many of the attributes are retained:
data.file.name |
The original value, wrapped with
|
ploidy |
Retained |
n.loci |
Retained |
n.samples |
Retained |
n.pops |
Retained |
pop.labels |
Retained |
pop.sizes |
Retained |
dataset.title |
Retained |
sample.title |
Retained |
pop.title |
Retained |
locus.names |
Retained |
locus.columns |
Modified to indicate the change to a single column per locus |
extra.columns |
Retained |
Douglas G. Scofield
genotype
, haplotype
, makeGenotypes
, makeHaplotypes
1 2 3 | data(Qagr_pericarp_genotypes)
dd <- as.genalex(head(Qagr_pericarp_genotypes, 40), force = TRUE)
as.genetics(dd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.