Learn R Programming

Demerelate (version 0.9-2)

Lin.reg.distance: Linear regression of empirical genetic relatedness with geographic distance.

Description

Function calculates mantel statistics and exports plots and matrices for regression of empirical genetic relatedness with geographic distance.

Usage

Lin.reg.distance(dist.m, emp.dist, pairs, tab.pop.pop, offhalf.list, offfull.list, relate.off.non.Mxy.mean, file.output, directory.name, out.name, inputdata, object, value, iteration)

Arguments

dist.m
Object provided by geo.dist.
emp.dist
Empirical relatedness of population.
pairs
Number of bootstrap replicates to calculate confidence interval for linear regression.
tab.pop.pop
Population information to model linear fit.
offhalf.list
Object - matrix of mean pairwise relatedness of each randomized comparison of half siblings.
offfull.list
Object - matrix of mean pairwise relatedness of each randomized comparison of full siblings.
relate.off.non.Mxy.mean
Object - matrix of mean pairwise relatedness of each randomized comparison of non relatives.
file.output
logical - Should a cluster dendogram, histograms and .txt files be sent as standard output in your working directory. In some cases (inflating NA values) it may be necessary that this value has to be set as FALSE due to problems in calculating clusters on pairwise NA values.
directory.name
Name of the directory results are sent to.
out.name
Filename of the output.
inputdata
R object or external file to be read internally with standard Demerelate inputformat. Dataframe will be split by population information and calculations will run separately. If no reference population information is specified (reference.pop = "NA") all information on loci are used as reference by omitting population information.
object
Information whether inputdata are an object or should be read in as file.
value
String defining method to calculate allele sharing or similarity estimates. Can be set as "Bxy", "Sxy", "Mxy", "Li", "lxy", "rxy", "loiselle", "wang.fin", "wang", "ritland", "morans.fin" or "morans" allele.sharing.
iteration
Number of bootstrap iterations in $F_{is}$ calculations.

Value

Summary statistics from mantel correlation of geogrphical distance and mean relatedness over loci are exported as list object.

Details

Mantel statistics is calculated by mantel(...) from vegan package for datasets. Similarities are transformed to distances by D=1-S for each estimator. For visualization a scatterplot is exported with relatedness thresholds calculated for each dataset to get an idea of the relatedness between genetic and geographic distance in addition to mantel statistics.

References

Oksanen, J. et al. (2013) vegan: Community Ecology Package. R package version 2.0-8

See Also

geo.dist allele.sharing Demerelate

Examples

Run this code
    ## internal function not intended for direct use
    
     
     

Run the code above in your browser using DataLab