writeSegregJoinMap: Write genotypes for JoinMap/MapQTL

View source: R/quantgen.R

writeSegregJoinMapR Documentation

Write genotypes for JoinMap/MapQTL

Description

Write genotype data in the JoinMap format into a "loc" file used by this software.

Usage

writeSegregJoinMap(
  pop.name,
  pop.type = "CP",
  locus,
  segregs,
  genos,
  phases = NULL,
  classifs = NULL,
  file,
  save.ind.names = TRUE,
  na.string = "--",
  verbose = 1
)

Arguments

pop.name

name of the population

pop.type

type of the population

locus

vector of locus names; should be shorter or equal to 20 characters, otherwise a warning will be issued; should be in the same order as the rows of the "genos" argument

segregs

vector of segregation types; should be in the same order as the rows of the "genos" argument

genos

data frame containing genotypes encoded in the JoinMap format, similar to the output from genoClasses2JoinMap

phases

vector of phase types (optional; should be in the same order as the rows of the "genos" argument)

classifs

vector of classification types (optional; should be in the same order as the rows of the "genos" argument)

file

name of the file in which the data will be saved (will be compressed if ends with ".gz" and "gzip" is available in the PATH)

save.ind.names

if TRUE, individual names will be saved at the end of the file

na.string

character to replace NA's in "genos"

verbose

verbosity level (0/1)

Value

nothing

Author(s)

Timothee Flutre

See Also

genoClasses2JoinMap, readSegregJoinMap, writeGenMapJoinMap, writePhenoJoinMap

Examples

## Not run: ## make fake data
nb.snps <- 6
x <- data.frame(par1=c("AA", "GC", "CG", "AT", NA, "AA"),
                par2=c("AT", "GC", "GG", "AT", "AT", "AT"),
                off1=c("AA", "GG", "CG", "AA", "AA", "AT"),
                off2=c("AT", "GG", "CG", "AT", "AT", "AA"),
                off3=c("AT", "GG", "GG", "TT", "TT", NA),
                off4=c(NA, NA, NA, NA, NA, NA),
                row.names=paste0("snp", 1:nb.snps),
                stringsAsFactors=FALSE)
jm <- genoClasses2JoinMap(x=x, reformat.input=TRUE, thresh.na=2, verbose=1)
idx <- which(! is.na(jm$seg))
writeSegregJoinMap(pop.name="test", pop.type="CP", locus=rownames(jm[idx,]),
                   segregs=jm[idx,"seg"], genos=jm[idx,-c(1:9)], file="test.txt")

## End(Not run)

timflutre/rutilstimflutre documentation built on Feb. 7, 2024, 8:17 a.m.