write.ATetra: Write Genotypes in ATetra Format

View source: R/dataexport.R

write.ATetraR Documentation

Write Genotypes in ATetra Format

Description

write.ATetra uses genotype and population information contained in a genambig object to create a text file of genotypes in the ATetra format.

Usage

write.ATetra(object, samples = Samples(object),
             loci = Loci(object), file = "")

Arguments

object

A genambig object containing the dataset of interest. Genotypes, population identities, population names, and the dataset description are used for creating the file. Ploidies must be set to 4.

samples

A character vector of samples to write to the file. This is a subset of Samples(object).

loci

A character vector of loci to write to the file. This is a subset of Loci(object).

file

A character string indicating the path and name to which to write the file.

Details

Note that missing data are not allowed in ATetra, although write.ATetra will still process missing data. When it does so, it leaves all alleles blank in the file for that particular sample and locus, and also prints a warning indicating which sample and locus had missing data.

Value

A file is written but no value is returned.

Author(s)

Lindsay V. Clark

References

http://www.vub.ac.be/APNA/ATetra_Manual-1-1.pdf

van Puyvelde, K., van Geert, A. and Triest, L. (2010) ATETRA, a new software program to analyze tetraploid microsatellite data: comparison with TETRA and TETRASAT. Molecular Ecology Resources 10, 331-334.

See Also

read.ATetra, write.Tetrasat, write.GeneMapper, write.POPDIST

Examples

# set up sample data (usually done by reading files)
mysamples <- c("ind1", "ind2", "ind3", "ind4")
myloci <- c("loc1", "loc2")
mygendata <- new("genambig", samples=mysamples, loci=myloci)
mygendata <- reformatPloidies(mygendata, output="one")
Genotypes(mygendata, loci="loc1") <- list(c(202,204), c(204),
                                          c(200,206,208,212),
                                          c(198,204,208))
Genotypes(mygendata, loci="loc2") <- list(c(78,81,84),
                                          c(75,90,93,96,99),
                                          c(87), c(-9))
PopInfo(mygendata) <- c(1,2,1,2)
PopNames(mygendata) <- c("this pop", "that pop")
Ploidies(mygendata) <- 4
Description(mygendata) <- "Example for write.ATetra."

## Not run: 
# write an ATetra file
write.ATetra(mygendata, file="atetratest.txt")

# view the file
cat(readLines("atetratest.txt"),sep="\n")

## End(Not run)



polysat documentation built on Aug. 23, 2022, 5:07 p.m.