mk.image: Make Image

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/mk.image.R

Description

This function produces a graphical representation of marker ancestry across individuals and facilitates visual inspection of variation in patterns of introgression among markers.

Usage

1
2
3
4
5
mk.image(introgress.data=NULL, loci.data=NULL,
         marker.order=NULL, hi.index=NULL, ind.touse=NULL,
         loci.touse=NULL, ylab.image="Individuals", main.image="",
         xlab.h="population 2 ancestry", col.image=NULL,
         pdf=TRUE, out.file="image.pdf")

Arguments

introgress.data

a list produced by prepare.data or a matrix with allele counts.

loci.data

a matrix or array providing marker information.

marker.order

a numeric or character vector specifying the order in which to plot markers, if marker.order=NULL the markers will be plotted in the order in which they occur in the introgress.data.

hi.index

a data frame produced by est.h or a numeric vector of hybrid index estimates.

ind.touse

vector specifying a subset of individuals to plot, if ind.touse=NULL all individuals will be included.

loci.touse

vector specifying a subset of markers to plot, if loci.touse=NULL all markers will be included.

ylab.image

character string giving the label for the y-axis.

main.image

character string giving the main label for the plot.

xlab.h

character string giving the x-axis label for the hybrid index portion of the plot.

col.image

vector of three colors to be used for the image plot, if col.image=NULL default colors will be used.

pdf

a logical specifying whether to print the plot to a pdf, if pdf=FALSE the current graphical output device will be used.

out.file

character string specifying the name of the output file for the image, if pdf=TRUE.

Details

introgress.data may either be the list that is returned by the function prepare.data, or, if fixed=TRUE, introgress.data may simply be a matrix or array providing counts of the number of alleles derived from parental population 1 for each admixed individual. If introgress.data is a matrix or array, rows and columns correspond to loci and individuals, respectively.

loci.data is a matrix or array where each row provides information on one locus. The first column gives a unique locus name (e.g. "locus3"), and the second column specifies whether the locus is co-dominant ("C" or "c"), haploid ("H" or "h"), or dominant ("D" or "d"). These first two columns in loci.data are required. The third column, which is optional, is a numeric value specifying the linkage groups for the marker. The fourth column, which is also optional, is a numeric value specifying both the linkage group and location on the linkage group (e.g. 3.70, for a marker at 70 cM on linkage group 3). If present, the third column will be used to draw breaks between and label linkage groups. The fourth column can be used to generate an order in which to plot markers (specified in marker.order).

This function (mk.image) produces a plot of marker specific ancestry for each individual. Each row corresponds to an individual and each column to a marker. Each marker/individual combination is colored dark green for homozygotes for alleles from parental population 1 (allele count of 2), medium green for interspecific heterozygotes (allele count of 1), light green for homozygotes for alleles from parental population 2 (allele count of 0), or white (missing data). Individuals are ordered according to hybrid index estimates, which are plotted to the right of the main plot.

Value

A plot is produced, but no value is returned.

Author(s)

Zachariah Gompert zgompert@uwyo.edu, C. Alex Buerkle buerkle@uwyo.edu

References

Gompert Z. and Buerkle C. A. (2009) introgress: a software package for mapping components of isolation in hybrids. Molecular Ecology Resources, in preparation.

See Also

prepare.data, est.h

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
## load simulated data
## markers have fixed differences, with
## alleles coded as 'P1' and 'P2'
data(AdmixDataSim1)
data(LociDataSim1)

## use prepare.data to produce introgress.data
introgress.data<-prepare.data(admix.gen=AdmixDataSim1,
                              loci.data=LociDataSim1,
                              parental1="P1", parental2="P2", pop.id=FALSE, 
                              ind.id=FALSE, fixed=TRUE)

## estimate hybrid index
hi.index<-est.h(introgress.data=introgress.data,
                loci.data=LociDataSim1, fixed=TRUE, p1.allele="P1",
                p2.allele="P2")

## produce image plot of marker ancestry
mk.image(introgress.data=introgress.data, loci.data=LociDataSim1,
         marker.order=NULL, hi.index=hi.index, ind.touse=NULL,
         loci.touse=NULL, ylab.image="Individuals", main.image="",
	 xlab.h="population 2 ancestry", col.image=NULL,
	 pdf=TRUE, out.file="image.pdf")

## End(Not run)

introgress documentation built on May 2, 2019, 7:24 a.m.