topKnet: Return consensus ranks from a matrix containing ranks

View source: R/combine.R

topKnetR Documentation

Return consensus ranks from a matrix containing ranks

Description

'topKnet' returns consensus ranks depending on the 'type' argument from 'ranks', a matrix containing the ranks per statistical 'model'.

Usage

topKnet(ranks, type, na.rm = TRUE)

Arguments

ranks

'matrix' containing the ranks per statistical model (in columns) and per feature pair (in rows)

type

'character', either '"top1"', '"top2"' or '"mean"'

na.rm

'logical', if set to 'TRUE', the 'NA's in the assay slots will not be taken into account when creating the '"top1"', '"top2"' or '"mean"' of ranks. If set to 'FALSE', the 'NA's will be taken into account when creating the '"top1"', '"top2"' or '"mean"' ranks. If 'FALSE' the resulting aggregations will be 'NA' if an 'NA' is present in the coeffients of one feature pair.

Details

See Hase et al. (2014) for further details.

Value

'numeric' 'vector“ with consensus ranks

Author(s)

Thomas Naake, thomasnaake@googlemail.com

References

Hase et al. (2014): Harnessing Diversity towards the Reconstructing of Large Scale Gene Regulatory Networks. PLoS Computational Biology, 2013, e1003361, doi: [10.1371/journal.pcbi.1003361](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003361)

Examples

## na.rm == TRUE
ranks <- matrix(c(c(1, 2, 3), c(2, 1, 3)), ncol = 2)

## type = "top1"
MetNet:::topKnet(ranks = ranks, type = "top1", na.rm = TRUE)

## type = "top2"
MetNet:::topKnet(ranks = ranks, type = "top2", na.rm = TRUE)

## type = "mean"
MetNet:::topKnet(ranks = ranks, type = "mean", na.rm = TRUE)

## na.rm == FALSE
ranks <- matrix(c(c(1, 2, 3), c(2, 1, 3)), ncol = 2)

## type = "top1"
MetNet:::topKnet(ranks = ranks, type = "top1", na.rm = FALSE)

## type = "top2"
MetNet:::topKnet(ranks = ranks, type = "top2", na.rm = FALSE)

## type = "mean"
MetNet:::topKnet(ranks = ranks, type = "mean", na.rm = FALSE)

## na.rm == FALSE
ranks <- matrix(c(c(1, 2, NA), c(2, 1, 3)), ncol = 2)

## type = "top1"
MetNet:::topKnet(ranks = ranks, type = "top1", na.rm = FALSE)

## type = "top2"
MetNet:::topKnet(ranks = ranks, type = "top2", na.rm = FALSE)

## type = "mean"
MetNet:::topKnet(ranks = ranks, type = "mean", na.rm = FALSE)

tnaake/MetNet documentation built on Nov. 4, 2024, 4:45 a.m.