Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ra final

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information...
commit 5ebe425855bd33025fcb2aded1870209cc900452 1 parent 7406c2b
@gilleain gilleain authored egonw committed
View
13 src/main/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java
@@ -139,6 +139,8 @@ public IAtomType findMatchingAtomType(IAtomContainer atomContainer, IAtom atom)
type = perceiveGallium(atomContainer, atom);
} else if ("Ge".equals(atom.getSymbol())) {
type = perceiveGermanium(atomContainer, atom);
+ } else if ("Ra".equals(atom.getSymbol())) {
+ type = perceiveRadium(atomContainer, atom);
} else if ("Au".equals(atom.getSymbol())) {
type = perceiveGold(atomContainer, atom);
} else if ("Ag".equals(atom.getSymbol())) {
@@ -1822,6 +1824,17 @@ private IAtomType perceiveGold(IAtomContainer atomContainer, IAtom atom) throws
}
return null;
}
+
+ private IAtomType perceiveRadium(IAtomContainer atomContainer, IAtom atom) throws CDKException {
+ if (hasOneSingleElectron(atomContainer, atom)) {
+ return null;
+ } else if ((atom.getFormalCharge() != CDKConstants.UNSET
+ && atom.getFormalCharge() == 0)) {
+ IAtomType type = getAtomType("Ra.neutral");
+ if (isAcceptable(atom, atomContainer, type)) return type;
+ }
+ return null;
+ }
private int countAttachedDoubleBonds(IAtomContainer container, IAtom atom) {
return countAttachedDoubleBonds(container, atom, null);
View
9 src/main/org/openscience/cdk/dict/data/cdk-atom-types.owl
@@ -1710,7 +1710,14 @@
<at:piBondCount>0</at:piBondCount>
<at:hybridization rdf:resource="&at;sp3"/>
</at:AtomType>
-
+
+ <at:AtomType rdf:ID="Ra.neutral">
+ <at:formalCharge>0</at:formalCharge>
+ <at:hasElement rdf:resource="&elem;Ra"/>
+ <at:formalNeighbourCount>0</at:formalNeighbourCount>
+ <at:piBondCount>0</at:piBondCount>
+ </at:AtomType>
+
<at:AtomType rdf:ID="Au.1">
<at:formalCharge>0</at:formalCharge>
<at:hasElement rdf:resource="&elem;Au"/>
View
13 src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
@@ -3726,6 +3726,19 @@ public void testMethylphosphinicAcid() throws Exception {
}
@Test
+ public void test_Ra() throws Exception {
+ IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
+ IMolecule mol = builder.newInstance(IMolecule.class);
+ IAtom a1 = builder.newInstance(IAtom.class,"Ra");
+ a1.setFormalCharge(0);
+ mol.addAtom(a1);
+
+
+ String[] expectedTypes = {"Ra.neutral"};
+ assertAtomTypes(testedAtomTypes, expectedTypes, mol);
+ }
+
+ @Test
public void test_Cr_neutral() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
Please sign in to comment.
Something went wrong with that request. Please try again.