The function allows to create genetic graphs from genetic data by applying the conditional independence principle. Populations whose allelic frequencies covary significantly once the covariance with the other populations has been taken into account are linked on the graphs.
gen_graph_indep(
x,
dist = "basic",
cov = "sq",
pcor = "magwene",
alpha = 0.05,
test = "EED",
adj = "none",
output = "igraph"
)
A list
of objects of class matrix
, an object of
class matrix
or a graph object of class igraph
An object of class genind
that contains the multilocus
genotype (format 'locus') of the individuals as well as their population
and their geographical coordinates.
A character string indicating the method used to compute the multilocus genetic distance between populations
If 'dist = 'basic'' (default), then the multilocus genetic distance is computed using a Euclidean genetic distance formula (Excoffier et al., 1992)
If 'dist = 'weight'', then the multilocus genetic distance is computed as in Fortuna et al. (2009). It is a Euclidean genetic distance giving more weight to rare alleles
If 'dist = 'PG'', then the multilocus genetic distance is computed as in popgraph::popgraph function, following several steps of PCA and SVD (Dyer et Nason, 2004).
If 'dist = 'PCA'', then the genetic distance is computed following a PCA of the matrix of allelic frequencies by population. It is a Euclidean genetic distance between populations in the multidimensional space defined by all the independent principal components.
A character string indicating the formula used to compute the covariance matrix from the distance matrix
If 'cov = 'sq'' (default), then the covariance matrix is calculated from the matrix of squared distances as in Everitt et Hothorn (2011)
If 'cov = 'dist'', then the covariance matrix is calculated from the matrix of distances as in Dyer et Nason (2004) and popgraph function
A character string indicating the way the partial correlation matrix is computed from the covariance matrix.
If 'pcor = 'magwene'', the steps followed are the same as in Magwene (2001) and in popgraph::popgraph function. It is the recommended option as it meets mathematical requirements.
If 'pcor = 'other'', the steps followed are the same as used by Fortuna et al. (2009). They are not consistent with the approach of Magwene (2001).
A numeric value corresponding to the statistical tolerance threshold used to test the difference from 0 of the partial correlation coefficients. By default, 'alpha=0.05'.
A character string indicating the method used to test the significance of the partial correlation coefficients.
If 'test = 'EED'' (default), then the Edge Exclusion Deviance criterion is used (Whittaker, 2009). Although other methods exist, this is the most common and thus the only one implemented here.
A character string indicating the way of adjusting p-values to assess the significance of the p-values
If 'adj = 'none'' (default), there is no p-value adjustment correction
If 'adj = 'holm'', p-values are adjusted using the sequential Bonferroni correction (Holm, 1979)
If 'adj = 'bonferroni'', p-values are adjusted using the classic Bonferroni correction
If 'adj = 'BH'', p-values are adjusted using Benjamini et Hochberg (1995) correction controlling false discovery rate
A character string indicating the matrices included in the output list.
If 'output = 'all'' (default), then D (distance matrix), C (covariance matrix), Rho (partial correlation matrix), M (graph incidence matrix) and S (strength matrix) are included
If 'output = 'dist_graph'', then the distance matrix D is returned only with the values corresponding to the graph edges
If 'output = 'str_graph'', then the strength values matrix S is returned only with the values corresponding to the graph edges
If 'output = 'inc'', then the binary adjacency matrix M is returned
If 'output = 'igraph'', then a graph of class igraph
is returned
P. Savary
The function allows to vary many parameters such as the genetic distance used, the formula used to compute the covariance, the statistical tolerance threshold, the p-values adjustment, among others.
dyer2004populationgraph4lg benjamini1995controllinggraph4lg bowcock1994highgraph4lg everitt2011introductiongraph4lg excoffier1992analysisgraph4lg fortuna2009networksgraph4lg holm1979simplegraph4lg magwene2001newgraph4lg wermuth1977algorithmgraph4lg whittaker2009graphicalgraph4lg
data(data_ex_genind)
dist_graph_test <- gen_graph_indep(x = data_ex_genind, dist = "basic",
cov = "sq", pcor = "magwene",
alpha = 0.05, test = "EED",
adj = "none", output = "igraph")
Run the code above in your browser using DataLab