Tabnine Logo
AtomContainerSet.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.openscience.cdk.AtomContainerSet
constructor

Best Java code snippets using org.openscience.cdk.AtomContainerSet.<init> (Showing top 20 results out of 315)

origin: cdk/cdk

  @Override
  public IChemObject newTestObject() {
    return new AtomContainerSet();
  }
});
origin: org.openscience.cdk/cdk-legacy

@Override
public void startDocument() {
  chemFile = new ChemFile();
  chemSequence = new ChemSequence();
  chemModel = new ChemModel();
  setOfMolecules = new AtomContainerSet();
}
origin: cdk/cdk

@BeforeClass
public static void setUp() {
  setTestObjectBuilder(new ITestObjectBuilder() {
    @Override
    public IChemObject newTestObject() {
      return new AtomContainerSet();
    }
  });
}
origin: cdk/cdk

@Test
public void testExampleFile_SupportColumns() throws Exception {
  String filename = "data/moss/TKO.mossoutput";
  InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
  MoSSOutputReader reader = new MoSSOutputReader(ins);
  IAtomContainerSet moleculeSet = new AtomContainerSet();
  moleculeSet = reader.read(moleculeSet);
  Assert.assertEquals(5.06, Double
      .valueOf(moleculeSet.getAtomContainer(0).getProperty("focusSupport").toString()).doubleValue(), 0.01);
  Assert.assertEquals(1.74,
      Double.valueOf(moleculeSet.getAtomContainer(0).getProperty("complementSupport").toString())
          .doubleValue(), 0.01);
}
origin: cdk/cdk

@Test
public void testReadingSmiFile_1() throws Exception {
  String filename = "data/smiles/smiles.smi";
  logger.info("Testing: " + filename);
  InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
  SMILESReader reader = new SMILESReader(ins);
  IAtomContainerSet som = reader.read(new AtomContainerSet());
  String name = null;
  IAtomContainer thisMol = som.getAtomContainer(0);
  name = ((String) thisMol.getProperty("SMIdbNAME")).toString();
  Assert.assertEquals("benzene", name);
}
origin: cdk/cdk

@Test
public void testReading() throws Exception {
  String filename = "data/smiles/smiles.smi";
  logger.info("Testing: " + filename);
  InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
  SMILESReader reader = new SMILESReader(ins);
  IAtomContainerSet som = reader.read(new AtomContainerSet());
  Assert.assertEquals(8, som.getAtomContainerCount());
}
origin: cdk/cdk

@Test
public void testReadingSmiFile_3() throws Exception {
  String filename = "data/smiles/test3.smi";
  logger.info("Testing: " + filename);
  InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
  SMILESReader reader = new SMILESReader(ins);
  IAtomContainerSet som = reader.read(new AtomContainerSet());
  Assert.assertEquals(5, som.getAtomContainerCount());
}

origin: cdk/cdk

@Test
public void testExampleFile_MolReading() throws Exception {
  String filename = "data/moss/TKO.mossoutput";
  InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
  MoSSOutputReader reader = new MoSSOutputReader(ins);
  IAtomContainerSet moleculeSet = new AtomContainerSet();
  moleculeSet = reader.read(moleculeSet);
  Assert.assertEquals(19, moleculeSet.getAtomContainerCount());
  for (IAtomContainer mol : moleculeSet.atomContainers()) {
    Assert.assertEquals(Integer.valueOf(mol.getProperty("atomCount").toString()).intValue(), mol.getAtomCount());
    Assert.assertEquals(Integer.valueOf(mol.getProperty("bondCount").toString()).intValue(), mol.getBondCount());
  }
}
origin: cdk/cdk

@Test
public void testReadingSmiFile_2() throws Exception {
  String filename = "data/smiles/smiles.smi";
  logger.info("Testing: " + filename);
  InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename);
  SMILESReader reader = new SMILESReader(ins);
  IAtomContainerSet som = reader.read(new AtomContainerSet());
  IAtomContainer thisMol = som.getAtomContainer(1);
  Assert.assertNull(thisMol.getProperty("SMIdbNAME"));
}
origin: cdk/cdk

@Test
public void testAtomContainerSet() {
  IAtomContainerSet som = new AtomContainerSet();
  Assert.assertNotNull(som);
  Assert.assertEquals(0, som.getAtomContainerCount());
}
origin: cdk/cdk

@Test
public void testWrite_IAtomContainerSet_SingleMolecule() throws Exception {
  StringWriter writer = new StringWriter();
  IAtomContainerSet molSet = new AtomContainerSet();
  IAtomContainer molecule = new AtomContainer();
  molecule.addAtom(new Atom("C"));
  molSet.addAtomContainer(molecule);
  SDFWriter sdfWriter = new SDFWriter(writer);
  sdfWriter.write(molSet);
  sdfWriter.close();
  Assert.assertTrue(writer.toString().indexOf("$$$$") != -1);
}
origin: cdk/cdk

@Test
public void testWrite_IAtomContainerSet_Properties() throws Exception {
  StringWriter writer = new StringWriter();
  IAtomContainerSet molSet = new AtomContainerSet();
  IAtomContainer molecule = new AtomContainer();
  molecule.addAtom(new Atom("C"));
  molecule.setProperty("foo", "bar");
  molSet.addAtomContainer(molecule);
  SDFWriter sdfWriter = new SDFWriter(writer);
  sdfWriter.write(molSet);
  sdfWriter.close();
  Assert.assertTrue(writer.toString().indexOf("<foo>") != -1);
  Assert.assertTrue(writer.toString().indexOf("bar") != -1);
}
origin: cdk/cdk

@Test
public void testWrite_IAtomContainerSet_CDKProperties() throws Exception {
  StringWriter writer = new StringWriter();
  IAtomContainerSet molSet = new AtomContainerSet();
  IAtomContainer molecule = new AtomContainer();
  molecule.addAtom(new Atom("C"));
  molecule.setProperty(InvPair.CANONICAL_LABEL, "bar");
  molSet.addAtomContainer(molecule);
  SDFWriter sdfWriter = new SDFWriter(writer);
  sdfWriter.write(molSet);
  sdfWriter.close();
  Assert.assertTrue(writer.toString().indexOf(InvPair.CANONICAL_LABEL) == -1);
}
origin: cdk/cdk

@Test
public void testWrite_IAtomContainerSet_Properties_Off() throws Exception {
  StringWriter writer = new StringWriter();
  IAtomContainerSet molSet = new AtomContainerSet();
  IAtomContainer molecule = new AtomContainer();
  molecule.addAtom(new Atom("C"));
  molecule.setProperty("foo", "bar");
  molSet.addAtomContainer(molecule);
  SDFWriter sdfWriter = new SDFWriter(writer);
  Properties sdfWriterProps = new Properties();
  sdfWriterProps.put("writeProperties", "false");
  sdfWriter.addChemObjectIOListener(new PropertiesListener(sdfWriterProps));
  sdfWriter.customizeJob();
  sdfWriter.write(molSet);
  sdfWriter.close();
  String result = writer.toString();
  Assert.assertFalse(result.contains("<foo>"));
}
origin: cdk/cdk

@Test
public void testWrite_IAtomContainerSet_MultIAtomContainer() throws Exception {
  StringWriter writer = new StringWriter();
  IAtomContainerSet molSet = new AtomContainerSet();
  IAtomContainer molecule = new AtomContainer();
  molecule.addAtom(new Atom("C"));
  molSet.addAtomContainer(molecule);
  molecule = new AtomContainer();
  molecule.addAtom(new Atom("C"));
  molSet.addAtomContainer(molecule);
  SDFWriter sdfWriter = new SDFWriter(writer);
  sdfWriter.write(molSet);
  sdfWriter.close();
  Assert.assertTrue(writer.toString().indexOf("$$$$") != -1);
}
origin: cdk/cdk

@Test
public void testMoleculeSet() throws Exception {
  IAtomContainerSet list = new AtomContainerSet();
  list.addAtomContainer(new AtomContainer());
  list.addAtomContainer(new AtomContainer());
  IChemModel model = new ChemModel();
  model.setMoleculeSet(list);
  IChemModel roundTripped = CMLRoundTripTool.roundTripChemModel(convertor, model);
  IAtomContainerSet newList = roundTripped.getMoleculeSet();
  Assert.assertNotNull(newList);
  Assert.assertEquals(2, newList.getAtomContainerCount());
  Assert.assertNotNull(newList.getAtomContainer(0));
  Assert.assertNotNull(newList.getAtomContainer(1));
}
origin: cdk/cdk

@Test
public void testRemoveElectronContainer_IAtomContainerSet_IElectronContainer() {
  IAtomContainerSet ms = new AtomContainerSet();
  IAtomContainer mol = new AtomContainer();
  mol.addAtom(new Atom("O"));
  mol.addAtom(new Atom("O"));
  mol.addBond(0, 1, IBond.Order.DOUBLE);
  IBond bond = mol.getBond(0);
  ms.addAtomContainer(mol);
  IBond otherBond = new Bond(new Atom(), new Atom());
  AtomContainerSetManipulator.removeElectronContainer(ms, otherBond);
  Assert.assertEquals(1, AtomContainerSetManipulator.getBondCount(ms));
  AtomContainerSetManipulator.removeElectronContainer(ms, bond);
  Assert.assertEquals(0, AtomContainerSetManipulator.getBondCount(ms));
}
origin: cdk/cdk

@Test
public void testRemoveElectronContainer_IAtomContainerSet_IElectronContainer() {
  IAtomContainerSet ms = new AtomContainerSet();
  IAtomContainer mol = new AtomContainer();
  mol.addAtom(new Atom("O"));
  mol.addAtom(new Atom("O"));
  mol.addBond(0, 1, IBond.Order.DOUBLE);
  IBond bond = mol.getBond(0);
  ms.addAtomContainer(mol);
  IBond otherBond = new Bond(new Atom(), new Atom());
  MoleculeSetManipulator.removeElectronContainer(ms, otherBond);
  Assert.assertEquals(1, MoleculeSetManipulator.getBondCount(ms));
  MoleculeSetManipulator.removeElectronContainer(ms, bond);
  Assert.assertEquals(0, MoleculeSetManipulator.getBondCount(ms));
}
origin: cdk/cdk

@Test
public void testRemoveAtomAndConnectedElectronContainers_IAtomContainerSet_IAtom() {
  IAtomContainerSet ms = new AtomContainerSet();
  IAtomContainer mol = new AtomContainer();
  mol.addAtom(new Atom("O"));
  mol.addAtom(new Atom("O"));
  mol.addBond(0, 1, IBond.Order.DOUBLE);
  IAtom atom = mol.getAtom(0);
  ms.addAtomContainer(mol);
  IAtom otherAtom = new Atom("O");
  MoleculeSetManipulator.removeAtomAndConnectedElectronContainers(ms, otherAtom);
  Assert.assertEquals(1, MoleculeSetManipulator.getBondCount(ms));
  Assert.assertEquals(2, MoleculeSetManipulator.getAtomCount(ms));
  MoleculeSetManipulator.removeAtomAndConnectedElectronContainers(ms, atom);
  Assert.assertEquals(0, MoleculeSetManipulator.getBondCount(ms));
  Assert.assertEquals(1, MoleculeSetManipulator.getAtomCount(ms));
}
origin: cdk/cdk

@Test
public void testRemoveAtomAndConnectedElectronContainers_IAtomContainerSet_IAtom() {
  IAtomContainerSet ms = new AtomContainerSet();
  IAtomContainer mol = new AtomContainer();
  mol.addAtom(new Atom("O"));
  mol.addAtom(new Atom("O"));
  mol.addBond(0, 1, IBond.Order.DOUBLE);
  IAtom atom = mol.getAtom(0);
  ms.addAtomContainer(mol);
  IAtom otherAtom = new Atom("O");
  AtomContainerSetManipulator.removeAtomAndConnectedElectronContainers(ms, otherAtom);
  Assert.assertEquals(1, AtomContainerSetManipulator.getBondCount(ms));
  Assert.assertEquals(2, AtomContainerSetManipulator.getAtomCount(ms));
  AtomContainerSetManipulator.removeAtomAndConnectedElectronContainers(ms, atom);
  Assert.assertEquals(0, AtomContainerSetManipulator.getBondCount(ms));
  Assert.assertEquals(1, AtomContainerSetManipulator.getAtomCount(ms));
}
org.openscience.cdkAtomContainerSet<init>

Javadoc

Constructs an empty AtomContainerSet.

Popular methods of AtomContainerSet

  • addAtomContainer
    Adds an atomContainer to this container with the given multiplier.
  • clone
    Clones this AtomContainerSet and its content.
  • getAtomContainerCount
    Returns the number of AtomContainers in this Container.
  • getMultiplier
    Returns the multiplier of the given AtomContainer.
  • notifyChanged
  • removeAtomContainer
    Removes an AtomContainer from this container.
  • setMultiplier
    Sets the coefficient of a AtomContainer to a given value.
  • add
    Adds all atomContainers in the AtomContainerSet to this container.
  • addListener
  • addProperties
  • atomContainers
    Get an iterator for this AtomContainerSet.
  • getAtomContainer
    Returns the AtomContainer at position number in the container.
  • atomContainers,
  • getAtomContainer,
  • getFlag,
  • getFlags,
  • getID,
  • getListenerCount,
  • getMultipliers,
  • getProperties,
  • getProperty

Popular in Java

  • Making http post requests using okhttp
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now