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

Generalize Needleman-Wunsch alignment #16

Merged
merged 1 commit into from
May 17, 2024
Merged

Generalize Needleman-Wunsch alignment #16

merged 1 commit into from
May 17, 2024

Conversation

timholy
Copy link
Member

@timholy timholy commented May 17, 2024

The initial application of NW alignment was to find TM anchors. In that
case, one is aligning a "probe" structure to 14 specific "reference
residues," and thus the problem is quite asymmetric. There are
applications where we would rather do "symmetric" alignment. This is
basically a complete rewrite of the NW alignment code to allow for this.

With the centroid/sidechain distance-based penalty, recommended gapcosts
are: 5Å for extend, 20Å for open. These approximately maximize the
agreement with the MSA pairings.

The initial application of NW alignment was to find TM anchors. In that
case, one is aligning a "probe" structure to 14 specific "reference
residues," and thus the problem is quite asymmetric. There are
applications where we would rather do "symmetric" alignment. This is
basically a complete rewrite of the NW alignment code to allow for this.

With the centroid/sidechain distance-based penalty, recommended gapcosts
are: 5Å for extend, 20Å for open. These approximately maximize the
agreement with the MSA pairings.
Comment on lines +301 to +304
# Saturating arithmetic to prevent overflow of Integer types
# https://discourse.julialang.org/t/the-performance-of-saturating-operations-or-adding-intrinsics/48575
# (thanks!)
saturating_add2(x::T, y::T) where {T <: Unsigned} = x + min(~x, y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for including the link! This is something I often forget about, since we often work with floats

Copy link
Contributor

@tmcgrath325 tmcgrath325 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! It's a relief to hear that distance-based alignments from generalized NW don't look too scary when compared to the MSAs.

@timholy timholy merged commit 66b822c into main May 17, 2024
1 of 3 checks passed
@timholy timholy deleted the teh/nw2 branch May 17, 2024 15:03
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.

2 participants