[Bioc-devel] efficient use of edgeData (graph)

Nishant Gopalakrishnan ngopalak at fhcrc.org
Wed Nov 10 20:20:24 CET 2010


Hi Paul,

Why not directly use the edgeData function with the attribute name you
want instead of having to retrieve the edgeData for all the attributes
and then subsetting.

ie   edgeData(graph, from  , to , attr = edge.attribute.name)

Nishant

On 11/10/2010 07:01 AM, Paul Shannon wrote:
> In the RCytoscape package I have a convenience function which returns the values of a specified edge attribute, for all edges in the graph.  It is ponderously slow on a graph of 9000 edges.
>
> I define it this way:
>
> function (graph, edge.attribute.name) {
>   unlist (sapply (names (edgeData (graph)), function (n) edgeData (graph)[[n]][[edge.attribute.name]]))
>   }
>
> Can anyone suggest ways to speed this up?   I fear I am missing something obvious.
>
> Thanks!
>
>  - Paul
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>



More information about the Bioc-devel mailing list