Dont allow p(unpaired) to be less than 0 #843
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 DasLab/arnie#50