-
Notifications
You must be signed in to change notification settings - Fork 3
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
Assembly scoring: fix #158 and solve ties in assembly scoring #161 #163
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -587,19 +587,36 @@ public void score() { | |
indx++; | ||
} | ||
|
||
// This is done when multiple assemblies are high scoring | ||
indx = 0; | ||
List<Integer> indices = new ArrayList<Integer>(); | ||
for (Assembly a:uniques) { | ||
if (a.getScore() == maxScore){ | ||
indices.add(indx); | ||
} | ||
indx++; | ||
} | ||
|
||
// Warn if low probability density of valid assemblies | ||
if (sumProbs < 0.5) { | ||
logger.warn("The total probability of valid assemblies is only {}. " | ||
+ "Assembly ennumeration may be incomplete.", String.format("%.2f", sumProbs)); | ||
} | ||
|
||
// Do not normalize the score (easy to do afterwards though) | ||
// Do not normalize the score (easy to do afterwards in the DB though) | ||
//for (Assembly a:uniques) | ||
// a.normalizeScore(sumProbs); | ||
|
||
// 3 Assign the BIO call to the highest probability | ||
if (uniques.size() > 0) | ||
uniques.get(maxIndx).setCall(CallType.BIO); | ||
// 3 Assign the BIO call to the highest probability, if unique assembly | ||
if (uniques.size() > 0) { | ||
if (indices.size() == 1) { | ||
uniques.get(maxIndx).setCall(CallType.BIO); | ||
} else { | ||
for (Integer i:indices) { | ||
uniques.get(i).setCall(CallType.NO_PREDICTION); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What call should we assign to all the assemblies with the same high score? Here I choose NOPRED. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about we use BIO for several assemblies? Is that possible? or would something else break because of that? Otherwise if we don't want to do several BIOs, then I'd rather go for a strategy like @sbliven proposed: choose the one with lowest stoichiometry. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot recall anything that would break if two assemblies are assigned as BIO, I am OK with this solution. The only problem I can see is with the user interpretation, maybe we should think what does a user expect or show a help message for such cases. |
||
} | ||
} | ||
} | ||
|
||
// 4 Compute call confidence | ||
for (Assembly a:uniques) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I use some epsilon for the comparison, or do we trust score differences even if they are very tiny?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we should do this for strict ties only (those comparing as equals), let's trust the tiny differences to do the sorting job otherwise.