[Baypiggies] a python puzzle

Brent Pedersen bpederse at gmail.com
Thu Apr 15 03:09:22 CEST 2010

On Wed, Apr 14, 2010 at 8:20 AM, Brent Pedersen <bpederse at gmail.com> wrote:
> hi, in trying to write a func that does a kind of merging of 2 sorted lists,
> i've come up with a fairly simple implementation that "almost works":
> http://gist.github.com/365485
> but it hits StopIteration before returning the last value ([9], None)
> i can wrap the whole thing in a bunch more if statements, i've tried
> heapq.merge, but cant find a nice solution.
> any ideas? i think it's an interesting problem.
> -brent

hey, thanks for all the input, damon and i ended up with this:
not too bad, i guess.

the real application is for a (huge) set of short sequences aligned to
2 different genomes. i need to do different things with a sequence
depending on whether it aligned to genome a, genome b or to both. and
since the grouping function is an argument, i have a number of other
possible uses.

More information about the Baypiggies mailing list