amnh / PCG

𝙋𝙝𝙮𝙡𝙤𝙜𝙚𝙣𝙚𝙩𝙞𝙘 𝘾𝙤𝙢𝙥𝙤𝙣𝙚𝙣𝙩 𝙂𝙧𝙖𝙥𝙝 ⸺ Haskell program and libraries for general phylogenetic graph search
28 stars 1 forks source link

Create more contextualized alignment type in result #18

Closed recursion-ninja closed 4 years ago

recursion-ninja commented 7 years ago

Issue by recursion-ninja Monday Apr 03, 2017 at 17:40 GMT Originally opened as https://github.com/ima-hima/PCG/issues/18


The Data.These module exports a unique Bifunctor which, when combined with the Align class from Data.Align, resembles a dynamic character alignment. With slight modification to the type, we could create an analogous type for alignments:

data AlignmentIndex a b 
   = Insert a 
   | Delete b
   | Align a b

Storing a Traversable structure of AlignmentIndex would allow us to quickly generate both DeletionEvents and InsertionEvents e in different parts of the codebase. This would however, not play nicely with the current FFI alignmnet bindinds to sequentialAlidn and foreignAlign, as we would have to perform extra work to construct the AlignmentIndex a b sequence.

recursion-ninja commented 4 years ago

The initial implmentation has been added. See commit: aefbe5187373502a2db101785f400c9917a607f1

We still need to optimize the implementations to be as performant as possible.

recursion-ninja commented 4 years ago

This has been completed with the addition of the Implied Alignment algorithm.