Permalink
Browse files

Pu final

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
1 parent c684298 commit 0eebd74512a8c1e2e755da6dbc9b643561563e6f @gilleain gilleain committed with egonw Jul 21, 2011
@@ -135,6 +135,8 @@ public IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)
type = perceiveGallium(atomContainer, atom);
} else if ("Ge".equals(atom.getSymbol())) {
type = perceiveGermanium(atomContainer, atom);
+ } else if ("Pu".equals(atom.getSymbol())) {
+ type = perceivePlutonium(atomContainer, atom);
} else if ("Th".equals(atom.getSymbol())) {
type = perceiveThorium(atomContainer, atom);
} else if ("K".equals(atom.getSymbol())) {
@@ -1667,6 +1669,14 @@ private IAtomType perceivePotassium(IAtomContainer atomContainer, IAtom atom) th
}
return null;
}
+
+ private IAtomType perceivePlutonium(IAtomContainer atomContainer, IAtom atom) throws CDKException {
+ if (atom.getFormalCharge() == 0 && atomContainer.getConnectedBondsCount(atom) == 0) {
+ IAtomType type = getAtomType("Pu");
+ if (isAcceptable(atom, atomContainer, type)) return type;
+ }
+ return null;
+ }
private int countAttachedDoubleBonds(IAtomContainer container, IAtom atom) {
return countAttachedDoubleBonds(container, atom, null);
@@ -1663,4 +1663,11 @@
<at:hybridization rdf:resource="&at;sp2"/>
</at:AtomType>
+ <at:AtomType rdf:ID="Pu">
+ <at:formalCharge>0</at:formalCharge>
+ <at:hasElement rdf:resource="&elem;Pu"/>
+ <at:formalNeighbourCount>0</at:formalNeighbourCount>
+ <at:piBondCount>0</at:piBondCount>
+ </at:AtomType>
+
</rdf:RDF>
@@ -3690,6 +3690,19 @@ public void testMethylphosphinicAcid() throws Exception {
}
@Test
+ public void test_Pu() throws Exception {
+ IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
+ IMolecule mol = builder.newInstance(IMolecule.class);
+ IAtom a1 = builder.newInstance(IAtom.class,"Pu");
+ a1.setFormalCharge(0);
+ mol.addAtom(a1);
+
+
+ String[] expectedTypes = {"Pu"};
+ assertAtomTypes(testedAtomTypes, expectedTypes, mol);
+ }
+
+ @Test
public void test_Th() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);

0 comments on commit 0eebd74

Please sign in to comment.