Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IChemObjectBuilder


  /**
   * Returns the exact mass of an element. Mass is obtained from the CDK
   * library.
   */
  public static double getElementMass(String element) {
    IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
    IsotopeFactory isotopeFac;
    try {
      isotopeFac = IsotopeFactory.getInstance(builder);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    this.minCount = min;
    this.maxCount = max;

    try {
      // Use CDK to obtain element's mass
      IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
      IsotopeFactory ifac = IsotopeFactory.getInstance(builder);
      elementObject = ifac.getMajorIsotope(elementSymbol);
      elementMass = elementObject.getExactMass();
    } catch (IOException e) {
      // This can never happen
View Full Code Here

  public static IsotopePattern calculateIsotopePattern(
      String molecularFormula, double minAbundance, int charge,
      Polarity polarity) {

    IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();

    IMolecularFormula cdkFormula = MolecularFormulaManipulator
        .getMolecularFormula(molecularFormula, builder);

    return calculateIsotopePattern(cdkFormula, minAbundance, charge,
View Full Code Here

            try {
               
                final IAtomContainer selection = renderModel.getSelection().getConnectedAtomContainer();
               
                if(selection!=null){
                    final IChemObjectBuilder bldr = selection.getBuilder();
                    IChemModel selectionModel = bldr.newInstance(IChemModel.class);
                    selectionModel.setMoleculeSet(bldr.newInstance(IAtomContainerSet.class));
                    selectionModel.getMoleculeSet().addAtomContainer(selection);
                    sysClip.setContents(new SmilesSelection(CreateSmilesAction.getSmiles(selectionModel)), null);
                }else{
                    sysClip.setContents(new SmilesSelection(CreateSmilesAction.getSmiles(chemModel)),null);
                }
View Full Code Here

      getUndoRedoHandler().postEdit(undoredo);
    }
  }

  public static void generateNewCoordinates(IAtomContainer container) {
    IChemObjectBuilder builder = DefaultChemObjectBuilder
        .getInstance();

    if (diagramGenerator == null) {
      diagramGenerator = new StructureDiagramGenerator();
      diagramGenerator.setTemplateHandler(new TemplateHandler(builder));
    }
    if (container instanceof IAtomContainer) {
      diagramGenerator.setMolecule((IAtomContainer) container);
    } else {
      diagramGenerator.setMolecule(builder.newInstance(IAtomContainer.class,container));
    }

    try {
      diagramGenerator.generateExperimentalCoordinates();
      IAtomContainer cleanedMol = diagramGenerator.getMolecule();
View Full Code Here

TOP

Related Classes of org.openscience.cdk.interfaces.IChemObjectBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.