getSingleLayerGraphIDs {GeneAnswers} | R Documentation

## retrieve direct interacted nodes for given IDs and interaction Matrix

### Description

A function to retrieve direct interacted nodes for given IDs and interaction Matrix with specified filtered IDs.

### Usage

    getSingleLayerGraphIDs(graphIDs, edgeM, remove=TRUE, filterGraphIDs=NULL, directed=FALSE, UP=TRUE)

### Arguments

`graphIDs` | a character vector for given IDs
`edgeM` | a 2-column Matrix representing connectionship
`remove` | logic, remove the non-connection graphIDs in the return values
`filterGraphIDs` | a chacater vector for filtered IDs
`directed` | logic, the network is a directed or not
`UP` | logic, determine search Parents or Children. Only valid for directed relation.

### Details

edgeM is a 2-column matrix. For directional connection, the direction is from column 1 elements to column 2 elements. For non-directional connection, each connection should be reversely presented twice, one is from column 1 element to column 2 element, while another is from column 2 element to column 1 element. In other words, non-directional connection is considered as two reverse directional connections. filterGraphIDs is used to only keep nodes in filterGraphIDs.

### Value

return a list representing a network.

### Author(s)

Gang Feng, Pan Du and Simon Lin

### References

Feng, G., Du, P., Krett, N., Tessel, M., Rosen, S., Kibbe, W.A. and Lin, S.M., 'A collection of bioconductor methods to visualize gene-list annotations', BMC Research Notes 2010, 3:10

### Examples

    m <- matrix(c('1','4', '2', '6', '1', '5', '3', '7', '5', '2'), ncol=2, byrow=TRUE)
    m
    getSingleLayerGraphIDs(c('1','2','3'), m)

    # if the connection is not directional, the connection between '5' and '2' will be missed without changing m.
    m <- rbind(m, c('2', '5'))
    getSingleLayerGraphIDs(c('1','2','3'), m)

[Package GeneAnswers version 2.28.0 Index]