R/Covariance_matrix_functions.R
graph_based_covariance_construction_multi.Rd
Function that constructs the genetic covariance matrix given a graph around a proband and extracts the threshold information from the graph.
graph_based_covariance_construction_multi(
fam_id,
pid,
cur_proband_id,
cur_family_graph,
h2_vec,
genetic_corrmat,
phen_names,
add_ind = TRUE
)
Name of column with the family ID
Name of column of personal ID
id of proband
local graph of current proband
vector of liability scale heritabilities
matrix with genetic correlations between considered phenotypes. Must have same order as h2_vec.
Names of the phenotypes, as given in cur_family_graph.
whether to add genetic liability of the proband or not. Defaults to true.
list with three elements. The first element is temp_tbl, which contains the id of the current proband, the family ID and the lower and upper thresholds for all phenotypes. The second element, cov, is the covariance matrix of the local graph centred on the current proband. The third element is newOrder, which is the order of ids from pid and phen_names pasted together, such that order can be enforced elsewhere too.