Description Usage Arguments Details Value Author(s) See Also Examples
Converts an object of class genalex
to a data frame of class
'loci'
from the
pegas
package. This data frame is similar to one of class genalex
,
in that it mixes genetic and other data in the same data frame, but
its conversion of multiple allele columns to single genotype columns
is similar to the result of the as.genetics
function
of this package.
1 | as.loci.genalex(x, phased = FALSE, check.annotation = TRUE, ...)
|
x |
Annotated data frame of class |
phased |
Still some details to work out. Default |
check.annotation |
If |
... |
Additional arguments, currently ignored |
Like class genalex
, class 'loci'
can encode genotypes of
any ploidy. Once a class genalex
object is converted to class
'loci'
, it may be further converted to other data structures for
analysis with
pegas
and
adegenet.
The specific changes that occur to an object of
class genalex
for it to become an object of class 'loci'
:
Row names are set from sample names
The first column of sample names is removed
The population column is renamed "population"
, with
its original name retained in the "pop.title"
attribute.
It is also encoded as a factor.
The individual alleles of a locus are merged into a single
column, with alleles separated by "/"
(phased = FALSE
) or "|"
(phased = TRUE
).
These columns are encoded as factors.
The "locus.columns"
attribute is updated to reflect that
all alleles at a locus are now joined into a single column
A new attribute "locicol"
required by class 'loci'
is added, with a value identical to the "locus.columns"
attribute
The class
is changed from c(genalex, 'data.frame')
to c('loci', 'data.frame')
Because of the removal of the sample name column and the additional allele
columns, the number of columns will be reduced by 1 plus the number of loci.
For further details of the structure of class loci
, see
http://ape-package.ird.fr/pegas/DefinitionDataClassesPegas.pdf.
Because class 'loci'
can readily encode additional columns, the
extra columns of a class genalex
object can be bound with
cbind
as additional columns.
This is a specialised wrapper around the function
as.loci.data.frame
from the
pegas
package.
x
as an object of class 'loci'
, which is a data
frame with the genotype of each locus encoded as factors. Additional
changes apply, see Details.
Douglas G. Scofield
1 2 3 4 5 | suppressPackageStartupMessages(require(pegas))
data(Qagr_pericarp_genotypes)
dd <- as.genalex(head(Qagr_pericarp_genotypes, 15), force = TRUE)
as.loci(dd)
str(as.loci(dd, phased = TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.