ldweight_edges: Include linkage disequilibrium information in the network.

View source: R/ld.R

ldweight_edgesR Documentation

Include linkage disequilibrium information in the network.

Description

Include linkage disequilibrium information in the SNP network. The weight of the edges will be lower the higher the linkage is.

Usage

ldweight_edges(net, ld, method = "inverse")

Arguments

net

A SNP network.

ld

A dsCMatrix or dgCMatrix containing linkage disequilibrium measures, like the output of ld.

method

How to incorporate linkage-disequilibrium values into the network.

Value

An copy of net where the edges weighted according to linkage disequilibrium.

Examples

ld <- snpStats::ld(minigwas[['genotypes']], depth = 2, stats = "R.squared")
# don't weight edges for which LD cannot be calculated
ld[is.na(ld)] <- 0
gi <- get_GI_network(minigwas, snpMapping = minisnpMapping, ppi = minippi)
ldGi <- ldweight_edges(gi, ld)

hclimente/martini documentation built on Feb. 26, 2024, 6:23 p.m.