PoonLab / OpenRDP

An open-source re-implementation of the RDP4 recombination detection program
GNU General Public License v3.0
45 stars 9 forks source link

Make Triplet a generator? #49

Closed ArtPoon closed 1 year ago

ArtPoon commented 1 year ago

Triplet is an object class that is being initialized with the full lists of sequences and labels, and then three integers to index into these lists. Then we are looping over all possible triplets and constructing a Triplet object at each iteration. This seems really inefficient to me. I would rather call Triplet once and call its next method to retrieve the next object.

ArtPoon commented 1 year ago

I need to fix the unit tests first, then I'll try implementing this change.

GopiGugan commented 1 year ago

https://github.com/PoonLab/OpenRDP/blob/676045af328253e450df4d332e46e8dab3519586/openrdp/__init__.py#L251-L258

ArtPoon commented 1 year ago

new branch iss49, commit 7b7dd25bf38a1d3e992e168e7674869022a823af