Skip to content

Support non-normalized probability matrices in hungarian#50

Merged
luxaritas merged 1 commit intomasterfrom
normalize-hungarian
Feb 1, 2025
Merged

Support non-normalized probability matrices in hungarian#50
luxaritas merged 1 commit intomasterfrom
normalize-hungarian

Conversation

@luxaritas
Copy link
Contributor

This was implemented by @jandersonlee to support RNet, which outputs a confidence matrix rather than a probability matrix (ie, in RNet all rows/columns do not necessarily need to sum to 1) - in that case hungarian would wind up outputting invalid structures (with unbalanced pairs) as it would attempt to pair bases multiple times.

Reviewed by @rkretsch, and I also ran tests against our PK50 dataset that ensured results were unchanged for vienna/contrafold/eternafold bpps.

@luxaritas luxaritas merged commit ab1dfe2 into master Feb 1, 2025
3 checks passed
@luxaritas luxaritas deleted the normalize-hungarian branch February 1, 2025 00:38
luxaritas added a commit to eternagame/EternaJS that referenced this pull request Feb 28, 2025
Conventionally, dot plots are probability matrices such that for any
base, the probability that it will pair with any other base will sum to
1, less the probability that it is unpaired - with probability unpaired
excluded, so to get the probability unpaired we sum and subtract from 1.
However for an algorithm like ribonanzanet, the dot plot is instead a
likelihood matrix such that the liklihood of each pair is independent of
every other pair, meaning it could sum to more than 1. We now clip
P(unp) to so that if the row sums to a value > 1, we don't drop p(unp)
to be below 0, which doesn't make sense (it is still ambiguous what
p(unp) should be if you have two pairs at .75 liklihood, but this is at
least _better_).

This reflects a change made in WaymentSteeleLab/arnie#50
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.

1 participant