Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/compare.clines.R
This function contrasts patterns of introgression between two hybrid zones.
1 2 | compare.clines(cline.data1=NULL,cline.data2=NULL,sig.test=FALSE,
n.reps=1000)
|
cline.data1 |
a list that is the product of the
|
cline.data2 |
a list that is the product of the
|
sig.test |
a logical specifying whether to perform significance testing. |
n.reps |
numeric value specifying the number of permutations to conduct for signficance testing. |
This function estimates that likelihood of the count data from
cline.data2
given the regression models from cline.data1
and cline.data2
and returns the log ratio of the
latter to the former. cline.data1
and cline.data2
are
lists returned by genomic.clines
each based on a different hybrid
zone between the same parental populations or species; the molecular
markers and parental allele frequencies should be the same for both
hybrid zones. The range of hybrid index estimates for individuals
comprising cline.data2
should exceed the range of hybrid index
estimated for individuals comprising cline.data1
to avoid
predicting allele counts using the regression model from
cline.data1
beyond the range of hybrid indexes that were included
in the original model. The log likelihood ratios returned by this
function can be used to determine the degree of congruence for marker
specific patterns of introgression between the analyzed hybrid
zones. This function includes a permutation procedure for testing
whether log likelihood ratios are significantly greater than expected by
chance, which is invoked by setting sig.test = TRUE
. This option
should only be employed when both hybrid zones contain many individuals
with low and high hybrid index estimates to minimized the problem
described above.
See Gompert and Buerkle (2009a, 2009b) for additional details and examples.
A matrix with log likelihood ratios for each marker and P-values from
significance testing if sisg.test = TRUE
.
Zachariah Gompert zgompert@uwyo.edu, C. Alex Buerkle buerkle@uwyo.edu
Gompert Z. and Buerkle C. A. (2009) A powerful regression-based method for admixture mapping of isolation across the genome of hybrids. Molecular Ecology, 18, 1207-1224.
Gompert Z. and Buerkle C. A. (2009) introgress: a software package for mapping components of isolation in hybrids. Molecular Ecology Resources, in preparation.
genomic.clines
, prepare.data
, est.h
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | ## 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, p1.allele="P1",
p2.allele="P2")
## random sampling to divide data into two sets of 100 individuals,
## this creates two admixed populations (hybrid zones)
numbs<-sample(1:200,200,replace=FALSE)
sam1<-numbs[1:100]
sam2<-numbs[101:200]
## estimate genomic clines for each data set,
## significance testing is not conducted
clines.out1<-genomic.clines(introgress.data=introgress.data,
hi.index=hi.index,loci.data=LociDataSim1,
sig.test=FALSE, ind.touse=sam1)
clines.out2<-genomic.clines(introgress.data=introgress.data,
hi.index=hi.index,loci.data=LociDataSim1,
sig.test=FALSE, ind.touse=sam2)
## compare clines between data sets, with significance testing
comp.out<-compare.clines(clines.out1,clines.out2,sig.test=TRUE,
n.reps=1000)
write.table(comp.out, file="compareClines.txt",
quote=FALSE, sep=",")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.