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

Martin Morgan mtmorgan at fhcrc.org
Fri Nov 2 00:18:02 CET 2012


On 11/01/2012 01:23 PM, risclab 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
> data
> type of the result of acc(). Is it a list in a list?

Hi -- best to ask questions about Bioconductor packages on the Bioconductor 
mailing list.

http://bioconductor.org/help/mailing-list/

The help page ?acc says

Value:

      The methods should return a named list of integer vectors. The
      'names' of the list correspond to the names of the supplied nodes.

and for a reproducible example after

 > example(acc)

we have

 > class(acc(gR3, "A"))
[1] "list"
 > class(acc(gR3, "A")[[1]])
[1] "numeric"

so the return type is a named list of named numeric vectors. as(gR3, "matrix") 
might also provide an easily computable structure.

Martin

>
> Thank you
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/GraphNEL-object-retrieve-edgenumber-from-acc-or-is-it-list-of-lists-tp4648174.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
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 R-help mailing list