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

allow gap penalties to be a function of position on reference #424

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DavidBJaffe
Copy link
Contributor

For some applications, it is desirable that the gap open and gap extend penalties vary
as a function of the position on the target (second) sequence. We encountered this when
aligning a V(D)J transcript to a concatenated V(D)J reference, where we wanted to encourage
gaps at the junction points between the reference segments.

This PR provides a solution that works, but is awkward. In alignment/pairwise/mod.rs,
we add a function custom_with_gap_fns, that is a copy of custom, except that it has two
extra arguments specifying the gap penalties, and each instance of gap_open and gap_extend
in the function are modified accordingly. This is the only change.

The extra arguments are vectors. Ideally they could be closures, although for our application,
vectors are fine. And the code duplication is awful.

It was not clear to us how to implement an elegant solution without breaking the existing
public API (and I'm not sure how to do even that).

Perhaps there is a better solution.

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.1%) to 85.717% when pulling 1007419 on DavidBJaffe:gap_penalties_as_functions into b6cb869 on rust-bio:master.

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

Successfully merging this pull request may close these issues.

None yet

2 participants