Description Slots Author(s) See Also Examples
An S4 class storing multi-allelic locus or sequence data along with a current stratification and option stratification schemes.
data
a data.table where the first column contains the sample ID
(ids
). The second column contains the sample stratification
(strata
). The third column to the end contains the allelic data as
one column per locus. Alleles are on multiple rows per column with sample
IDs duplicated for all alleles. Column names are unique locus names.
sequences
a multidna object.
ploidy
integer representing the ploidy of the data. There are ploidy * the number of individuals rows in 'data'.
schemes
a data.frame with stratification schemes in each column. The rownames are individual names and must match the 'id' column of the 'data' slot. Each column is a factor.
description
a label for the object (optional).
other
a slot to carry other related information - currently unused in analyses (optional).
Eric Archer eric.archer@noaa.gov
df2gtypes
, sequence2gtypes
,
gtypes.accessors
, gtypes.initialize
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #--- create a diploid (microsatellite) gtypes object
data(dolph.msats)
data(dolph.strata)
strata.schemes <- dolph.strata[, c("broad", "fine")]
rownames(strata.schemes) <- dolph.strata$id
msats.g <- new("gtypes", gen.data = dolph.msats[, -1], ploidy = 2,
ind.names = dolph.msats[, 1], schemes = strata.schemes)
msats.g
#--- create a haploid sequence (mtDNA) gtypes object and label haplotypes
data(dolph.seqs)
dloop.haps <- cbind(dLoop = dolph.strata$id)
rownames(dloop.haps) <- dolph.strata$id
dloop.g <- new("gtypes", gen.data = dloop.haps, ploidy = 1,
schemes = strata.schemes, sequences = dolph.seqs,
strata = "fine")
dloop.g
labelHaplotypes(dloop.g, "Hap.")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.