% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_geno.R
\name{plot_geno}
\alias{plot_geno}
\title{Plot multiple individuals' genome-wide genotypes}
\usage{
plot_geno(
  geno,
  map,
  ind = NULL,
  chr = NULL,
  gap = 0,
  col = NULL,
  na_col = "white",
  chrlines = "white",
  swap_axes = FALSE,
  ...
)
}
\arguments{
\item{geno}{Imputed phase-known genotypes, as a list of matrices
(as produced by \code{\link[=maxmarg]{maxmarg()}}) or a list of
three-dimensional arrays (as produced by \code{\link[=guess_phase]{guess_phase()}}).}

\item{map}{Marker map (a list of vectors of marker positions).}

\item{ind}{Individuals to plot, either a numeric indexes or IDs.}

\item{chr}{Selected chromosomes to plot; a vector of character strings.}

\item{gap}{Gap between chromosomes}

\item{col}{Vector of colors for the different genotypes.}

\item{na_col}{Color for missing segments.}

\item{chrlines}{Color for lines separating chromosomes}

\item{swap_axes}{If TRUE, swap the axes, so that the chromosomes run horizontally.}

\item{...}{Additional graphics parameters}
}
\value{
None.
}
\description{
Plot multiple individuals' genome-wide genotypes
}
\examples{
# load data and calculate genotype probabilities
iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2"))
iron <- iron[1:50, ] # subset to first 50 individuals
map <- insert_pseudomarkers(iron$gmap, step=1)
pr <- calc_genoprob(iron, map, error_prob=0.002)

# infer genotypes, as those with maximal marginal probability
m <- maxmarg(pr, minprob=0.5)

# re-code the X chr, (5,6) -> (1,3)
m[["X"]] <- (m[["X"]] - 5)*2 + 1

# plot phased genotypes
plot_geno(m, map, col=c("#FFDC00", "#00C800", "#0064C9"))

# this is more interesting for Diversity Outbred mouse data
\dontrun{
file <- paste0("https://raw.githubusercontent.com/rqtl/",
               "qtl2data/main/DOex/DOex.zip")
DOex <- read_cross2(file)
# subset to first 25 individuals
DOex <- DOex[1:25, ]
pr <- calc_genoprob(DOex, error_prob=0.002)

# infer genotypes, as those with maximal marginal probability
m <- maxmarg(pr, minprob=0.5)
# guess phase
ph <- guess_phase(DOex, m)

# plot phased genotypes
plot_geno(ph, DOex$gmap)
}

}
\seealso{
\code{\link[=plot_onegeno]{plot_onegeno()}}, \code{\link[=plot_genoprob]{plot_genoprob()}}
}
