get_bg_related_kegg {PFP} | R Documentation

## get_bg_related_kegg

### Description

This function will select all genes in all kegg pathways which are directly connected with the genes in `gene_list`

### Usage

    get_bg_related_kegg(gene_list, PFPRefnet, rm_duplicated = FALSE)

### Arguments

`gene_list,` | a vector of characters, refers to genes ids
`PFPRefnet,` | an object of PFPRefnet class, it contains all kegg pathways.
`rm_duplicated,` | a logical, whether to remove the duplicated kegg edges in different pathways. Defalut is FALSE

### Details

It will return a data.frame which can be translated a graph or network. In the data.frame, `source` refers to the genes in `gene_list`, `target` refers to the directly connected genes in kegg, `weight` is 0.5, no real means, `pathway`refers to the pathway which the edge emerge and `edge_type` is "kegg".Note, if `rm_duplicated` is FALSE, it may return many duplicated edges,which will be complex when plotting a network. If `rm_duplicated` is TRUE,it will retain the first pathway which contains the duplicated edge.

### Value

the related kegg network.

### Examples

    data(PFPRefnet_hsa)
    data(gene_list_hsa)
    edges_kegg <- get_bg_related_kegg(gene_list_hsa,
                                      PFPRefnet=PFPRefnet_hsa,
                                      rm_duplicated = TRUE)

[Package PFP version 1.2.0 Index]