filterNetw: Filter nodes & edges for extracting networks This function...

View source: R/filterNetw.R

filterNetwR Documentation

Filter nodes & edges for extracting networks This function allows extracting and filtering network-data based on fixed threshold (limInt) and add sandwich-nodes (nodes inter-connecting initial nodes) out of node-based queries.

Description

Filter nodes & edges for extracting networks

This function allows extracting and filtering network-data based on fixed threshold (limInt) and add sandwich-nodes (nodes inter-connecting initial nodes) out of node-based queries.

Usage

filterNetw(
  lst,
  filtCol = 3,
  limInt = 5000,
  sandwLim = 5000,
  filterAsInf = TRUE,
  outFormat = "matrix",
  remOrphans = TRUE,
  remRevPairs = TRUE,
  elemNa = "genes",
  silent = FALSE,
  callFrom = NULL,
  debug = FALSE
)

Arguments

lst

(list, composed of multiple matrix or data.frames ) main input (each list-element should have same number of columns)

filtCol

(integer, length=1) which column of lst should be usd to filter using thresholds limInt and sandwLim

limInt

(numeric, length=1) filter main edge-scores according to filterAsInf

sandwLim

(numeric, length=1) filter sandwich connection edge-scores accodring to filterAsInf

filterAsInf

(logical) filter as 'inferior or equal' or 'superior or equal'

outFormat

(character) may be 'matrix' for tabular output, 'all' as list with matrix and list of node-names

remOrphans

(logical) remove networks consisting only of 2 connected edges

remRevPairs

(logical) remove duplicate edges due to reverse massping (eg A - B and B - A); NOTE : use only when edges don't have orientation !

elemNa

(character) used only for messages

silent

(logical) suppress messages

callFrom

(character) allow easier tracking of message(s) produced

debug

(logical) display additional messages for debugging

Value

This function returns a matrix or data.frame

See Also

in cbind

Examples


lst2 <- list('121'=data.frame(ID=as.character(c(141,221,228,229,449)),11:15), 
	 '131'=data.frame(ID=as.character(c(228,331,332,333,339)),11:15), 
  '141'=data.frame(ID=as.character(c(121,151,229,339,441,442,449)),c(11:17)), 
  '151'=data.frame(ID=as.character(c(449,141,551,552)),11:14),
  '161'=data.frame(ID=as.character(171),11), '171'=data.frame(ID=as.character(161),11),
  '181'=data.frame(ID=as.character(881:882),11:12) )

lst2 <- list('121'=data.frame(ID=as.character(c(141,221,228,229,449)),11:15, 21:25), 
	 '131'=data.frame(ID=as.character(c(228,331,332,333,339)),11:15, 21:25), 
  '141'=data.frame(ID=as.character(c(121,151,229,339,441,442,449)), c(11:17), 21:27), 
  '151'=data.frame(ID=as.character(c(449,141,551,552)), 11:14, 21:24),
  '161'=data.frame(ID=as.character(171), 11,21), '171'=data.frame(ID=as.character(161), 11,21),
  '181'=data.frame(ID=as.character(881:882), 11:12,21:22) )

(te1 <- filterNetw(lst2, limInt=90, remOrphans=FALSE))
(te2 <- filterNetw(lst2, limInt=90, remOrphans=TRUE))

(te3 <- filterNetw(lst2, limInt=13, remOrphans=FALSE))
(te4 <- filterNetw(lst2, limInt=13, remOrphans=TRUE))



wrMisc documentation built on Sept. 11, 2024, 6:10 p.m.