get_GGNet_adjacency_matrix {GGoutlieR}R Documentation

obtain an adjacency matrix to make a network graph

Description

'get_GGNet_adjacency_matrix' calculates p-values based on the KNNs and heuristic Gamma distribution obtained in the outlier identification processes. The matrices of p-values are then multiplied with the given genetic similarity matrix to form adjacency matrices.

Usage

get_GGNet_adjacency_matrix(
  ggoutlier_res,
  geo_coord,
  gen_coord,
  mutual = FALSE,
  adjust_p_value = TRUE
)

Arguments

ggoutlier_res

an output from 'ggoutlier'

geo_coord

a two-column matrix or data.frame. the first column is longitude and the second one is latitude.

gen_coord

a matrix of "coordinates in a genetic space". Users can provide ancestry coefficients or eigenvectors for calculation. If, for example, ancestry coefficients are given, each column corresponds to an ancestral population. Samples are ordered in rows as in 'geo_coord'. Users have to provide 'pgdM' if 'gen_coord' is not given.

mutual

logic. If a multi-stage test is used in the outlier identification, some samples could not be a mutual neighbor with its K nearest neighbors. In this case, setting 'mutual=TRUE' can force those samples to become mutual neighbors in the output adjacency matrix.

adjust_p_value

logic. If 'adjust_p_value=TRUE', p values are adjusted for each nearest neighbor of a given sample.

Value

a list consisting of four matrices that can be used in building network graphs. The default is 'TRUE' 'GeoSP_pvalue' is a matrix describing the strength of edges as p values from the empirical Gamma distribution identified by 'detect_outlier_in_GeoSpace' 'GenSP_pvalue' is a matrix describing the strength of edges as p values from the empirical Gamma distribution identified by 'detect_outlier_in_GeneticSpace'


[Package GGoutlieR version 1.0.2 Index]