Skip to content

Commit

Permalink
Gd final
Browse files Browse the repository at this point in the history
  • Loading branch information
gilleain authored and egonw committed Sep 3, 2011
1 parent ef34cca commit 770dc99
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
Expand Up @@ -2085,6 +2085,18 @@ private IAtomType perceiveAntimony(IAtomContainer atomContainer, IAtom atom) thr
}
return null;
}

private IAtomType perceiveGadolinum(IAtomContainer atomContainer, IAtom atom) throws CDKException {
if (atom.getFormalCharge() != CDKConstants.UNSET &&
atom.getFormalCharge() == +3 &&
atomContainer.getConnectedBondsCount(atom) == 0) {
IAtomType type = getAtomType("Gd.3plus");
if (isAcceptable(atom, atomContainer, type)) {
return type;
}
}
return null;
}

private int countAttachedDoubleBonds(IAtomContainer container, IAtom atom) {
return countAttachedDoubleBonds(container, atom, null);
Expand Down
8 changes: 8 additions & 0 deletions src/main/org/openscience/cdk/dict/data/cdk-atom-types.owl
Expand Up @@ -1920,6 +1920,14 @@
<at:hybridization rdf:resource="&at;sp3"/>
</at:AtomType>

<at:AtomType rdf:ID="Gd.3plus">
<at:formalCharge>3</at:formalCharge>
<at:hasElement rdf:resource="&elem;Gd"/>
<at:formalNeighbourCount>0</at:formalNeighbourCount>
<at:lonePairCount>0</at:lonePairCount>
<at:piBondCount>0</at:piBondCount>
</at:AtomType>

<at:AtomType rdf:ID="Sb.3">
<at:formalCharge>0</at:formalCharge>
<at:hasElement rdf:resource="&elem;Sb"/>
Expand Down
12 changes: 12 additions & 0 deletions src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
Expand Up @@ -3955,6 +3955,18 @@ public void testMethylphosphinicAcid() throws Exception {
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test
public void test_Gd_3plus() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class,"Gd");
a1.setFormalCharge(3);
mol.addAtom(a1);

String[] expectedTypes = {"Gd.3plus"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test
public void test_Mo_4() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
Expand Down

0 comments on commit 770dc99

Please sign in to comment.