<p>Hello,</p>

<p>I am interested in extracting information about the length of specific Reactome pathways (preferably using Bioconductor).</p>

<p>That is, given a pathway ID, I would like to know how many links it contains. Also, if possible, I would like to know how many links point to my Entity of interest, and how many links are there after it.</p>

<p>I am pretty new to bioinformatics and I hope I could make myself clear.</p>

<p>Thanks!</p>

You can use [graphite package](https://www.bioconductor.org/packages/release/bioc/html/graphite.html)

For example if you want to know how many nodes and edges are in the first reactome pathway:

    #load package
    library(graphite)
    require(igraph)
    #get all reactome pathways for human
    reactomedata=pathways(species = 'hsapiens','reactome')
    #information about the first pathway in the list
    reactomedata[[1]]
    # number of nodes
    length(nodes(reactomedata[[1]]))
    # number of edges
    dim(graphite::edges(reactomedata[[1]]))[1]

You can also create an igraph to calculate more topological indexes:

    # builds a graphNEL
    g <- pathwayGraph(reactomedata[[1]])
    # create an igraph from the graphNEL object
    g2=igraph.from.graphNEL(g, name = TRUE, weight = TRUE, unlist.attrs = TRUE)
    # calculate diameter
    diameter(g2)
    # calculate transitivity/clustering coefficient
    transitivity(g2)
    # calculate outdegree
    degree(g2,mode = 'out')
    # calculate indegree
    degree(g2,mode = 'in')

Obviously the topological indexes will change greatly if you have a directed edges, if you want to remove self loops and so on.