Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windowed predictions #9

Open
marcom opened this issue Jul 4, 2022 · 1 comment
Open

Windowed predictions #9

marcom opened this issue Jul 4, 2022 · 1 comment

Comments

@marcom
Copy link
Owner

marcom commented Jul 4, 2022

Following discussion in #7 (comment)

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:

  • call vrna_fold_compound() with option VRNA_OPTION_WINDOW
  • set the window size set with vrna_md_t.window_size
  • use the functions vrna_mfe_window_cb, vrna_mfe_window_zscore_cb, vrna_probs_window

A Julia interface could look like this:

  • mfe_window(cb::Function, fc::FoldCompound, ...)
  • mfe_window(fc::FoldCompound, ...)
  • probs_window(cb::Function, fc::FoldCompound, ...)
  • probs_window(fc::FoldCompound, ...)

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
Copy link
Owner Author

marcom commented Dec 20, 2022

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

cc @timoleistner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant