Commit
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -640,25 +640,31 @@ private double getBondScore(double score, Map<IBond, IBond> bondMaps) { | |
|
||
private double getBondFormalChargeMatches(IBond RBond, IBond PBond) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
double score = 0.0; | ||
if (RBond.getAtom(0).getID().equals(PBond.getAtom(0).getID()) | ||
&& RBond.getAtom(1).getID().equals(PBond.getAtom(1).getID())) { | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(0).getFormalCharge() != PBond.getAtom(0).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(0).getFormalCharge() - PBond.getAtom(0).getFormalCharge()); | ||
} | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(1).getFormalCharge() != PBond.getAtom(1).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(1).getFormalCharge() - PBond.getAtom(1).getFormalCharge()); | ||
} | ||
} else if (RBond.getAtom(1).getID().equals(PBond.getAtom(0).getID()) | ||
&& RBond.getAtom(0).getID().equals(PBond.getAtom(1).getID())) { | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(1).getFormalCharge() != PBond.getAtom(0).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(1).getFormalCharge() - PBond.getAtom(0).getFormalCharge()); | ||
} | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(0).getFormalCharge() != PBond.getAtom(1).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(0).getFormalCharge() - PBond.getAtom(1).getFormalCharge()); | ||
if (RBond != null | ||
&& PBond != null | ||
&& RBond.getAtom(0).getID() != null && PBond.getAtom(0).getID() != null | ||
&& RBond.getAtom(1).getID() != null && PBond.getAtom(1).getID() != null) { | ||
|
||
if (RBond.getAtom(0).getID().equals(PBond.getAtom(0).getID()) | ||
&& RBond.getAtom(1).getID().equals(PBond.getAtom(1).getID())) { | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(0).getFormalCharge() != PBond.getAtom(0).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(0).getFormalCharge() - PBond.getAtom(0).getFormalCharge()); | ||
} | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(1).getFormalCharge() != PBond.getAtom(1).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(1).getFormalCharge() - PBond.getAtom(1).getFormalCharge()); | ||
} | ||
} else if (RBond.getAtom(1).getID().equals(PBond.getAtom(0).getID()) | ||
&& RBond.getAtom(0).getID().equals(PBond.getAtom(1).getID())) { | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(1).getFormalCharge() != PBond.getAtom(0).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(1).getFormalCharge() - PBond.getAtom(0).getFormalCharge()); | ||
} | ||
if (!RBond.getOrder().equals(PBond.getOrder()) | ||
&& RBond.getAtom(0).getFormalCharge() != PBond.getAtom(1).getFormalCharge()) { | ||
score += Math.abs(RBond.getAtom(0).getFormalCharge() - PBond.getAtom(1).getFormalCharge()); | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
egonw
Member
|
||
} | ||
} | ||
return score; | ||
|
2 comments
on commit 2a7ee54
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.
The idea behind this class is to differentiate between charged atoms and non changed atoms. eg: the score will rank c=o > c-o± > c-o.
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.
Good. Such information would be useful to have as JavaDoc or comments in the source code. You know, but readers of your code do not. The whole point of Open Source is the many eyes, but just like with a journal publication, you must guide the reader through the test... JavaDoc, code comments, and good coding style are only for this purpose... not to make it more difficult to get your code accepted :)
JavaDoc on private methods is very much recommended. It is not entirely clear to me what this method is doing.