gtypes
ConstructorCreate a new '>gtypes object using
new("gtypes", ...)
, where '...
' are arguments
documented below.
# S4 method for gtypes
initialize(
.Object,
gen.data,
ploidy,
ind.names = NULL,
sequences = NULL,
strata = NULL,
schemes = NULL,
description = NULL,
other = NULL,
remove.sequences = FALSE
)
the object skeleton, automatically generated when
calling new
.
a vector, matrix, or data.frame containing the alleles at each locus. See below for more details.
ploidy of the loci.
an optional vector of individual sample names.
an optional stratification scheme from schemes
.
an optional data.frame of stratification schemes.
an optional description for the object.
other optional information to include.
logical. If TRUE
any sequences not referenced
For multi-allele loci, the gen.data
argument should be
formatted such that every consecutive ploidy
columns represent
alleles of one locus. Locus names are taken from the column names in
gen.data
and should be formatted with the same root locus name, with
unique suffixes representing alleles (e.g., for Locus1234: Locus1234.1
and Locus1234.2, or Locus1234_A and Locus1234_B).
If gen.data
is a vector it is assumed to represent haplotypes of a
haploid marker.
Sample names can be either in the rownames of gen.data
or given
separately in ind.names
. If ind.names
are provided, these are
used in lieu of rownames in gen.data
.
If schemes
has a column named 'id
', it will be used to match
to sample names in gen.data
. Otherwise, if rownames are present in
schemes
, a column named 'id
' will be created from them.
If sequences are provided in sequences
, then they should be named
and match values in the haplotype column in gen.data
. If multiple
genes are given as a '>multidna object, it is assumed that they
are in the same order as the columns in gen.data
.