strataG (version 2.4.905)

initialize,gtypes-method: gtypes Constructor

Description

Create a new '>gtypes object using new("gtypes", ...), where '...' are arguments documented below.

Usage

# 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
)

Arguments

.Object

the object skeleton, automatically generated when calling new.

gen.data

a vector, matrix, or data.frame containing the alleles at each locus. See below for more details.

ploidy

ploidy of the loci.

ind.names

an optional vector of individual sample names.

sequences

an optional '>multidna object containing sequences represented by each locus.

strata

an optional stratification scheme from schemes.

schemes

an optional data.frame of stratification schemes.

description

an optional description for the object.

other

other optional information to include.

remove.sequences

logical. If TRUE any sequences not referenced

Details

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.

See Also

df2gtypes, sequence2gtypes