Description Usage Arguments Details Value Author(s) See Also Examples
Load allelic data from a data.frame or matrix into a gtypes object.
1 2 3 4 5 6 7 8 9 10 11 |
x |
a matrix or data.frame of genetic data. |
ploidy |
number of number of columns in |
id.col |
column name or number where individual sample ids are stored.
If |
strata.col |
column name or number where stratification is stored. If
|
loc.col |
column number of first allele of first locus. |
sequences |
a list, matrix, |
schemes |
an optional data.frame of stratification schemes. |
description |
a label for the object (optional). |
other |
a list to carry other related information (optional). |
The genetic data in x
starting at loc.col
should be
formatted such that every consecutive ploidy
columns represent
alleles of one locus. Locus names are taken from the column names in
x
and should be formatted with the same root locus name, with
unique suffixes representing allels (e.g., for Locus1234: Locus1234.1
and Locus1234.2, or Locus1234_A and Locus1234_B).
If sequences are provided in sequences
, then they should be named
and match haplotype labels in loc.col
of x
. If multiple
genes are given as a multidna, then they should have the
same names as column names in x
from loc.col
to the end.
a gtypes object.
Eric Archer eric.archer@noaa.gov
gtypes.initialize, sequence2gtypes, as.data.frame.gtypes, gtypes2genind, gtypes2loci, gtypes2phyDat
1 2 3 4 5 6 7 8 9 10 11 12 | #--- create a diploid (microsatellite) gtypes object
data(dolph.msats)
ms.g <- df2gtypes(dolph.msats, ploidy = 2, strata.col = NULL, loc.col = 2)
ms.g
#' #--- create a haploid sequence (mtDNA) gtypes object
data(dolph.strata)
data(dolph.haps)
seq.df <- dolph.strata[ c("id", "broad", "dLoop")]
dl.g <- df2gtypes(seq.df, ploidy = 1, sequences = dolph.haps)
dl.g
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.