strataG (version 2.4.905)

writeGtypes: Write gtypes

Description

Write a '>gtypes object to file(s).

Usage

writeGtypes(
  g,
  label = NULL,
  folder = NULL,
  by.strata = TRUE,
  as.frequency = FALSE,
  freq.type = c("freq", "prop"),
  ...
)

Arguments

g

a '>gtypes object.

label

label for filename(s). Default is the gtypes description if present.

folder

folder where file(s) should be written to. If NULL, files are written to current working directory.

by.strata

if as.frequency == TRUE, calculate frequencies by strata?

as.frequency

logical indicating if haploid data should be output as frequency tables.

freq.type

if as.frequency == TRUE, write absolute frequencies ("freq") or proportions ("prop").

...

optional arguments controlling what information is included in the genotype file and how it is formatted passed to as.matrix.

Details

Writes a comma-delimited (.csv) file of genotypes and if sequences are present, a .fasta file for each locus. If haploid and as.frequency is TRUE, then frequency tables for each locus are written to separate files.

Examples

Run this code
# NOT RUN {
# Write microsatellites with one column per locus
data(msats.g)
writeGtypes(msats.g, one.col = TRUE)

# Write control region data as frequency tables
data(dloop.g)
writeGtypes(dloop.g, as.frequency = TRUE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab