[gt-users] gt_node_stream_pull() (was: get feature by ID)

Gordon Gremme gremme at gmail.com
Thu Feb 12 00:27:10 CET 2009


>>> on a sort of related note, one feature that would be nice is something
>>> to remove this boilerplate:
>>>
>>> genome_stream = FeatureStream(genome_stream, feature_index)
>>> feature = genome_stream.next_tree()
>>> while feature:
>>>     feature = genome_stream.next_tree()
>>>
>>> maybe with something like:
>>>
>>> FeatureStream(genome_stream, feature_index).iterate_all()
>>>
>>> that doesnt apply to the problem of make a name => feature hash, but
>>> is nice for filling a feature_index and doing an intron_stream.
>>
>> This is a nice idea and should be implementable without many problems as
>> a general method in the GenomeStream class.
>
> Yes, this would also simplify all the while loops which can be found
> in the tools.
> I'll implement this shortly on the C-side.

I just committed a method gt_node_stream_pull() which simplifies many
calls to gt_node_stream_next().
In fact, most calls to gt_node_stream_next() in the tools could be
simplified by calls to gt_node_stream_pull().
Please see the API documentation and the implementation of
gt_node_stream_pull() for details.

Any takers for the corresponding bindings?

Gordon


More information about the gt-users mailing list