Learn R Programming

RClone (version 1.0.3)

autocorrelation: Spatial Autocorrelation

Description

autocorrelation computes kinship coefficients (Loiselle or Ritland) between pairs of individuals within specific ranges of geographic distance.

Usage

autocorrelation(data1, haploid = FALSE, coords = NULL, vecpop = NULL, listMLL = NULL, 
	Loiselle = FALSE, Ritland = FALSE, 
	genet = FALSE, central_coords = FALSE, random_unit = FALSE, weighted = FALSE, 
	class1 = FALSE, class2 = FALSE, d = NULL, vecdist = NULL, 
	graph = FALSE, nbrepeat = NULL, export = FALSE)

Arguments

data1

a Rclone table with one allele per column.

haploid

logical, option, haploid indicates the ploidy level of data1.

coords

a table with coordinates of every units in data1.

vecpop

vector, option, vecpop indicates the population name of each unit of data1, if data1 contains several populations. If data1 contains only one population, leave vecpop = NULL.

listMLL

option, a custom list of MLL.

Loiselle

logical, if TRUE, Loiselle kinship coefficients are computed.

Ritland

logical, if TRUE, Ritland kinship coefficients are computed.

genet

option, TRUE keeps only MLG of data1.

central_coords

option, if genet = TRUE, central_coords computes central coordinates for each MLG/MLL.

random_unit

option, if genet = TRUE, random_unit keeps coordinates of only one unit per MLG/MLL.

weighted

option, if genet = TRUE, weighted computes a weighted matrix over ramets.

class1

option, if TRUE, computes distance classes of d equidistant classes.

class2

option, if TRUE, computes distance classes of d classes with the same number of units pairs each.

d

numeric, option, number of distance classes. By default, d = 10.

vecdist

option, a custom vector distance to construct distance classes.

graph

option, if TRUE, displays kinship coefficient between pairs plotted against distance.

nbrepeat

numeric, option, if pvalue = TRUE, nbrepeat is the number of resampling to enable pvalues computation.

export

option, if TRUE, graph is saved as .eps into working directory.

Value

autocorrelation returns a list (one population) or lists of list (several populations) of:

  • Main_results, a table with for each class, min, max, mean and ln(mean) of distance between two units, the number of pairs, the mean kinship coefficient and if pvalue = TRUE, the pvalue.

  • Slope_and_Sp_index, a table with slopes of the regression between genetic and geographic/log(geographic) distances and Sp and Sp_log (used to quantify Spatial Genetic Structure, Vekemans and Hardy, 2004) as observed values, mean and standard deviation of the simulated values, 95% and 90% confidence intervals and p-value.

  • Slope_resample, a table with slopes of the regression between genetic and geographic/log(geographic) distances at each pvalue.

  • Kinship_resample, a table with for each class in column and each pvalue in row the mean kinship coefficient.

  • Matrix_kinship_results, a dist object with kinship coefficients.

  • Class_kinship_results, a list of kinship coefficients by distance class.

  • Class_distance_results, a list of geographical distances by distance class.

Details

By default, d = 10 and autocorrelation computes 10 equidistant distance classes for all the ramets pairs. The function proposes 3 others options:

  • class1 fixing d equidistant classes,

  • class2 fixing d distance classes with the same number of units pairs,

  • maxdist = TRUE allowing the user to give a vector vecdist of intervals.

The function computes one of the two average kinship coefficients: Loiselle and Ritland.

Autocorrelation can be compute on ramets level, or genet level with:

  • central coordinates of each MLG/MLL,

  • a re-sampling approach which randomly allocates one of the unit's coordinates per MLG/MLL (Alberto 2005),

  • keeping all the ramets but weighting the matrix distances by a weighted matrix (Wagner 2005) where units of the same MLG/MLL are set to 0.

A permutation approach could be perform to assess pvalue and confidence intervals by permutation of the geographic coordinates among units. For the re-sampling approach, a unit of each MLG/MLL is randomly picked at each permutation. The p-value of mean kinship coefficients is related with the overall mean kinship coefficient: upper p-value (Monte Carlo) if greater or equal to the overall; otherwise, lower p-value. For b and Sp, their p-value correspond to upper p-value.

References

Loiselle et al., 1995, Spatial genetic structure of a tropical understory shrub, Psychotria officinalis (Rubiaceae).

Ritland, 1996, A marker-based method for inferences about quantitative inheritance in natural populations.

Arnaud-Haond et al., 2007, Standardizing methods to address clonality in population studies.

Vekemans & Hardy, 2004, New insights from fine-scale spatial genetic structure analyses in plant populations.

See Also

kinship_Loiselle, kinship_Ritland

Examples

Run this code
# NOT RUN {
data(posidonia)
data(coord_posidonia)

distGC <- c(0,10,15,20,30,50,70,76.0411073)

#res1 <- autocorrelation(posidonia, coords = coord_posidonia, Loiselle = TRUE, nbrepeat = 1000)

#res2 <- autocorrelation(posidonia, coords = coord_posidonia, Loiselle = TRUE, 
#class2 = TRUE, d = 7)

#res2[[1]] #Main_results
#res1[[2]] #Slope_and_Sp_index
#res2[[3]] #Slope_and_Sp_index

#res3 <- autocorrelation(posidonia, coords = coord_posidonia, Loiselle = TRUE, 
#vecdist = distGC, graph = TRUE)
# }

Run the code above in your browser using DataLab