Hi Titus,
the way I think about this is as a logical sequence: list, dictionary, graph:

- lists are sequences of single items k
- dictionaries are sets of pairs (k, v)
- graphs are sets of triples (source, dest, edge)

For a dictionary, the basic pattern is 
d[k] = v
for k, v in d.items()

For a graph, the analogous pattern is
g[source][dest] = edge
for source, dest, edge in g.edges()

You can use the edges() method in the same way on both the whole graph, or on 
an intermediate result of a query, i.e. g[source].edges().  For a "hypergraph" 
structure like NLMSA (where "nodes" can contain other nodes; in the NLMSA case 
that means an interval contains sub-intervals), the edges() method is very 
useful in this context because the actual mapping source:dest may be a 
sub-interval of the original query interval, and edges() reports that.

Sure, we could add values(), itervalues() methods to NLMSASlice; they would 
return edge objects.  Currently NLMSASlice does have items() and iteritems().

-- Chris

On Apr 3, 2010, at 9:55

-- 
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to pygr-...@googlegroups.com.
To unsubscribe from this group, send email to 
pygr-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en.

Reply via email to