marcom / ViennaRNA.jl

Julia interface to ViennaRNA for RNA structure prediction and analysis
Other
21 stars 1 forks source link

Windowed predictions #9

Open marcom opened 2 years ago

marcom commented 2 years ago

Following discussion in https://github.com/marcom/ViennaRNA.jl/issues/7#issuecomment-1173719544

For sliding window predictions on a sequence that produce an array of results instead of just one (one result for each window).

To use windowed predictions we have to do the following:

A Julia interface could look like this:

With the callback function in the first position so we can use do-notation to pass custom callback functions. The second version of each function without the callback just stores all the results in an array and returns that (by calling the first version with a callback that pushes each result to an array).

This style of callback function would also be something useful for subopt, pbacktrack, and maybe other functions where ViennaRNA accepts callback functions.

marcom commented 1 year ago

As of ViennaRNA 0.9.0, there are two new functions for windowed predictions: mfe_window and mfe_window_channel.

cc @timoleistner