# create a genotype object (usually done by reading a file)
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))
Ploidies(mygendata) <- 6
if (FALSE) {
# write a GeneMapper file
write.GeneMapper(mygendata, "exampleGMoutput.txt")
# view the file with read.table
read.table("exampleGMoutput.txt", sep="\t", header=TRUE)
}
# \dontshow{
write.GeneMapper(mygendata, tempfile())
# }
Run the code above in your browser using DataLab