% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/write_map.R
\name{write_map}
\alias{write_map}
\title{Write a genetic map to a file}
\usage{
write_map(map.list, file.out)
}
\arguments{
\item{map.list}{a map, i.e. an object of class \code{sequence} with a
predefined order, linkage phases, recombination fraction and likelihood or
a list of maps.}

\item{file.out}{output map file.}
}
\value{
file with genetic map information

Wang S., Basten, C. J. and Zeng Z.-B. (2010) Windows QTL Cartographer 2.5.
Department of Statistics, North Carolina State University, Raleigh, NC.
}
\description{
Write a genetic map to a file, base on a given map, or a list of maps. The
output file can be used as an input to perform QTL mapping using the package
R/qtl. It is also possible to create an output to be used with
QTLCartographer program.
}
\details{
This function is available only for backcross, F2 and RILs.
}
\examples{
\donttest{
data(mapmaker_example_f2)
twopt<-rf_2pts(mapmaker_example_f2)
lg<-group(make_seq(twopt, "all"))

##"pre-allocate" an empty list of length lg$n.groups (3, in this case)
maps.list<-vector("list", lg$n.groups)

for(i in 1:lg$n.groups){
  ##create linkage group i
  LG.cur <- make_seq(lg,i)
  ##ordering
  map.cur<-order_seq(LG.cur, subset.search = "sample")
  ##assign the map of the i-th group to the maps.list
  maps.list[[i]]<-make_seq(map.cur, "force")

  ##write maps.list to ".map" file
  write_map(maps.list, tempfile(fileext = ".map"))

}
}

}
\references{
Broman, K. W., Wu, H., Churchill, G., Sen, S., Yandell, B.
(2008) \emph{qtl: Tools for analyzing QTL experiments} R package version
1.09-43
}
\author{
Marcelo Mollinari, \email{mmollina@usp.br}
}
\keyword{rqtl}
