Convert a list into a SignedIndexList

SignedIndexList(object, ...)

# S4 method for list
SignedIndexList(object, keepNA = FALSE, keepDup = FALSE, offset = 1L)

Arguments

object

A list of lists, each with two elements named `pos` or `neg`, can be logical vectors or integer indices

...

additional arguments, currently ignored

keepNA

Logical, whether NA indices should be kept or not. Default: FALSE (removed)

keepDup

Logical, whether duplicated indices should be kept or not. Default: FALSE (removed)

offset

offset; 1 if missing

Value

A SignedIndexList, a list of lists, containing two vectors named `positive` and `negative`, which contain the indices of genes that are either positively or negatively associated with a certain phenotype

Examples

myList <- list(a = list(pos = list(1, 2, 2, 4), neg = c(TRUE, FALSE, TRUE)), 
b = list(NA), c = list(pos = c(c(2, 3), c(1, 3))))
SignedIndexList(myList)
#> A list of 3 signed indices with offset=1
#> Options: NA removed: TRUE; duplicates removed: TRUE
#>   a[n=5]
#>     positive[n=3]:1,2,4
#>     negative[n=2]:1,3
#>   b (no genes)
#>   c[n=3]
#>     positive[n=3]:2,3,1
#>     negative[n=0]:

## a special case of input is a single list with two elements, \code{pos} and \code{neg}
SignedIndexList(myList[[1]])
#> A list of 1 signed indices with offset=1
#> Options: NA removed: TRUE; duplicates removed: TRUE
#>   NONAME[n=5]
#>     positive[n=3]:1,2,4
#>     negative[n=2]:1,3