use of org.openscience.cdk.silent.PseudoAtom in project cdk by cdk.
the class AtomContainerManipulatorTest method dontSuppressHydrogensOnPseudoAtoms.
@Test
public void dontSuppressHydrogensOnPseudoAtoms() throws Exception {
// *[H]
IAtomContainer mol = new AtomContainer();
mol.addAtom(new PseudoAtom("*"));
mol.addAtom(new Atom("H"));
mol.getAtom(0).setImplicitHydrogenCount(0);
mol.getAtom(1).setImplicitHydrogenCount(1);
mol.addBond(0, 1, Order.SINGLE);
Assert.assertEquals(2, mol.getAtomCount());
IAtomContainer ac = AtomContainerManipulator.removeHydrogens(mol);
Assert.assertEquals(2, ac.getAtomCount());
}
use of org.openscience.cdk.silent.PseudoAtom in project cdk by cdk.
the class CDKToBeamTest method unknownSymbol.
@Test
public void unknownSymbol() throws Exception {
IAtom a = new PseudoAtom("ALA");
a.setImplicitHydrogenCount(0);
assertThat(new CDKToBeam().toBeamAtom(a).element(), is(Element.Unknown));
}
use of org.openscience.cdk.silent.PseudoAtom in project cdk by cdk.
the class CDKToBeamTest method unknownSymbol_Pseudo.
@Test
public void unknownSymbol_Pseudo() throws Exception {
IAtom a = new PseudoAtom("R1");
a.setImplicitHydrogenCount(0);
assertThat(new CDKToBeam().toBeamAtom(a).element(), is(Element.Unknown));
}
use of org.openscience.cdk.silent.PseudoAtom in project cdk by cdk.
the class CxSmilesTest method generateLabelledSmiles.
@Test
public void generateLabelledSmiles() throws CDKException {
IAtomContainer mol = new AtomContainer();
mol.addAtom(new Atom("C"));
mol.getAtom(0).setImplicitHydrogenCount(3);
mol.addAtom(new Atom("C"));
mol.getAtom(1).setImplicitHydrogenCount(2);
mol.addAtom(new PseudoAtom("R1"));
mol.getAtom(2).setImplicitHydrogenCount(0);
mol.addBond(0, 1, IBond.Order.SINGLE);
mol.addBond(1, 2, IBond.Order.SINGLE);
SmilesGenerator smigen = new SmilesGenerator(SmiFlavor.CxAtomLabel);
String smi = smigen.create(mol);
assertThat(smi, is("CC* |$;;R1$|"));
}
use of org.openscience.cdk.silent.PseudoAtom in project ambit-mirror by ideaconsult.
the class MarkushHelpers method toStringExhaustive.
public static String toStringExhaustive(SuppleAtomContainer sac) {
StringBuffer sb = new StringBuffer();
sb.append("Atom List" + endLine);
sb.append("--------------" + endLine);
for (int i = 0; i < sac.getAtomCount(); i++) {
IAtom at = sac.getAtom(i);
sb.append(" " + i + " ");
if (at instanceof PseudoAtom) {
sb.append("PseudoAtom: " + at.getClass().getName() + endLine);
// PseudoAtom pat = (PseudoAtom) at;
continue;
}
sb.append(at.getSymbol() + endLine);
}
return (sb.toString());
}
Aggregations