[BioC] GraphNEL object retrieve edgenumber from acc() or is it list of lists?

Martin Morgan mtmorgan at fhcrc.org
Sat Nov 3 20:02:55 CET 2012


On 11/02/2012 10:23 AM, schaefe9 at informatik.uni-bonn.de wrote:
> Hello everyone,
>
> Im working with graphNEL object and want to extract all the nodes which
> have adjacent nodes with at least 20 nodes in between them.
>
> acc(graph, graphnodes) obviously provides a list for the accessable
> nodes of every node from a node and a number of the edges between them.
> Like this:
>
> $`hsa:8379`
> hsa:100131844     hsa:10393    hsa:246184     hsa:29882     hsa:29945
>              1             1             1             1             1
>      hsa:51433     hsa:51434     hsa:51529     hsa:64682      hsa:8697
>              1             1             1             1             1
>
> $`hsa:51343`
> hsa:23594 hsa:23595  hsa:5001  hsa:5000  hsa:4999  hsa:4998
>          8         8         8         8         8         8
>
> and so on. However I want know access the numbers so that I can compare these
> edgenumbers and only retrieve the nodes with an accessable node with at least
> 20 edges as mentioned above. How can I achieve this? In addtion whats the

do you mean you want these nodes

    acclist = acc(graph, graphnodes)
    len = sapply(acclist, length)
    keep = names(len)[len > 20]

or maybe

   acc20plus = lapply(acclist, function(elt) elt[elt > 20])
   keep = names(acc20plus)[!sapply(acc20plus, length) > 0]

? To create a subgraph of these, then

   subGraph(keep, graph)

> data
> type of the result of acc(). Is it a list in a list?

ask the result

   class(acc(graph, graphnodes))
   str(acc(graph, graphnodes))

or the help page ?acc -- it's a named list of named integer vectors. Check out

   RShowDoc("R-intro")

for more help.

Martin

>
> Thank you
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>


-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list