• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IChemObjectBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.openscience.cdk.interfaces.IChemObjectBuilder的典型用法代码示例。如果您正苦于以下问题:Java IChemObjectBuilder类的具体用法?Java IChemObjectBuilder怎么用?Java IChemObjectBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IChemObjectBuilder类属于org.openscience.cdk.interfaces包,在下文中一共展示了IChemObjectBuilder类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getStructureAsAromaticIAtomContainer

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
public IAtomContainer getStructureAsAromaticIAtomContainer() {
	IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
	IAtomContainer fragmentStructure = builder.newInstance(IAtomContainer.class);
	
	for(int i = 0; i < this.bondsBitArray.getSize(); i++) {
		if(this.bondsBitArray.get(i)) {
			IBond curBond = this.precursorMolecule.getStructureAsIAtomContainer().getBond(i);
			if(this.precursorMolecule.isAromaticBond(i)) curBond.setIsAromatic(true);
			for(IAtom atom : curBond.atoms()) {
				atom.setImplicitHydrogenCount(0);
				if(this.precursorMolecule.isAromaticBond(i)) atom.setIsAromatic(true);
				fragmentStructure.addAtom(atom);
			}
			fragmentStructure.addBond(curBond);
		}
	}
//	loss of hydrogens
//	MoleculeFunctions.prepareAtomContainer(fragmentStructure);
	
	return fragmentStructure;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:22,代码来源:DefaultBitArrayFragment.java


示例2: getStructureAsIAtomContainer

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
public IAtomContainer getStructureAsIAtomContainer() {
	IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
	IAtomContainer fragmentStructure = builder.newInstance(IAtomContainer.class);
	
	for(int i = 0; i < this.bondsBitArray.getSize(); i++) {
		if(this.bondsBitArray.get(i)) {
			IBond curBond = this.precursorMolecule.getStructureAsIAtomContainer().getBond(i);
			for(IAtom atom : curBond.atoms()) {
				fragmentStructure.addAtom(atom);
			}
			fragmentStructure.addBond(curBond);
		}
	}
//	loss of hydrogens
//	MoleculeFunctions.prepareAtomContainer(fragmentStructure);
	
	return fragmentStructure;
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:19,代码来源:DefaultBitArrayFragment.java


示例3: createCOOH

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
public IMolecule createCOOH()
    {
        IChemObjectBuilder builder = NoNotificationChemObjectBuilder.getInstance();
        IMolecule molecule = builder.newMolecule();
        molecule.addAtom(builder.newAtom("C"));
        molecule.addAtom(builder.newAtom("O"));
        molecule.addBond(0, 1, IBond.Order.DOUBLE);
        molecule.addAtom(builder.newAtom("O"));
        molecule.addBond(0, 2, IBond.Order.SINGLE);

        try {

            AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
            LonePairElectronChecker lpcheck = new LonePairElectronChecker();
            lpcheck.saturate(molecule);

        }
        catch (CDKException e)
        {
            e.printStackTrace();
        }
//        Image image = MoleculeRenderer2D.renderMolecule(molecule, width, height);
//        new PanelWithBlindImageChart((BufferedImage) image, "0=C-OH").displayInTab();
        return molecule;
    }
 
开发者ID:dhmay,项目名称:msInspect,代码行数:26,代码来源:MetaboliteDBMatcherCLM.java


示例4: InChIToStructure

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
/**
    * Constructor. Generates CDK AtomContainer from InChI.
    * @param inchi
    * @throws CDKException
    */
public InChIToStructure(String inchi, IChemObjectBuilder builder) throws CDKException {
       try {
           input = new JniInchiInputInchi(inchi, "");
       } catch (JniInchiException jie) {
           throw new CDKException("Failed to convert InChI to molecule: " + jie.getMessage(), jie);
       }
       generateAtomContainerFromInchi(builder);
   }
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:14,代码来源:InChIToStructure.java


示例5: Structure2DComponent

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
public Structure2DComponent(String structure) throws CDKException,
    IOException {

// Create a silend CDK builder
IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();

// Create a new molecule instance
molecule = builder.newInstance(IAtomContainer.class);

// Load the structure into the molecule
MDLV2000Reader molReader = new MDLV2000Reader(new StringReader(
	structure));
molReader.read(molecule);
molReader.close();

// Suppress the hydrogens
AtomContainerManipulator.suppressHydrogens(molecule);

// If the model has no coordinates, let's generate them
if (!GeometryUtil.has2DCoordinates(molecule)) {
    StructureDiagramGenerator sdg = new StructureDiagramGenerator();
    sdg.setMolecule(molecule, false);
    sdg.generateCoordinates();
}

// Generators make the image elements
Font font = new Font("Verdana", Font.PLAIN, 14);
List<IGenerator<IAtomContainer>> generators = new ArrayList<IGenerator<IAtomContainer>>();
generators.add(new BasicSceneGenerator());
generators.add(new StandardGenerator(font));

// Renderer needs to have a toolkit-specific font manager
renderer = new AtomContainerRenderer(generators, new AWTFontManager());

// Set default atom colors for the renderer
RendererModel rendererModel = renderer.getRenderer2DModel();
rendererModel.set(StandardGenerator.AtomColor.class,
	new CDK2DAtomColors());

   }
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:41,代码来源:Structure2DComponent.java


示例6: setupIsotopeFactory

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
private void setupIsotopeFactory(IChemObjectBuilder builder) {
try {
	isotopeFactory = IsotopeFactory.getInstance(builder);
} catch (IOException e) {
	e.printStackTrace();
}
  }
 
开发者ID:yoann-dufresne,项目名称:Smiles2Monomers,代码行数:8,代码来源:SmilesGenerator.java


示例7: SmilesConverter

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
private SmilesConverter() {
	IChemObjectBuilder basic = DefaultChemObjectBuilder.getInstance();
	this.sp = new SmilesParser(basic);
	this.sp.setPreservingAromaticity(true);
	this.sg = new SmilesGenerator();
	this.sg.setUseAromaticityFlag(true);
	//this.hrf = new HanserRingFinder();
}
 
开发者ID:yoann-dufresne,项目名称:Smiles2Monomers,代码行数:9,代码来源:SmilesConverter.java


示例8: run

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
/**
 * @see java.lang.Runnable#run()
 */
public void run() {

    setStatus(TaskStatus.PROCESSING);

    resultWindow = new ResultWindow(
            "Searching for " + MZmineCore.getConfiguration().getMZFormat()
                    .format(searchedMass),
            peakListRow, searchedMass, charge, this);
    resultWindow.setVisible(true);

    logger.finest("Starting search for formulas for " + massRange + " Da");

    IsotopePattern detectedPattern = peakListRow.getBestIsotopePattern();
    if ((checkIsotopes) && (detectedPattern == null)) {
        final String msg = "Cannot calculate isotope pattern scores, because selected"
                + " peak does not have any isotopes. Have you run the isotope peak grouper?";
        MZmineCore.getDesktop().displayMessage(resultWindow, msg);
    }

    IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();

    generator = new MolecularFormulaGenerator(builder,
            massRange.lowerEndpoint(), massRange.upperEndpoint(),
            elementCounts);

    IMolecularFormula cdkFormula;
    while ((cdkFormula = generator.getNextFormula()) != null) {

        if (isCanceled())
            return;

        // Mass is ok, so test other constraints
        checkConstraints(cdkFormula);

    }

    if (isCanceled())
        return;

    logger.finest("Finished formula search for " + massRange
            + " m/z, found " + foundFormulas + " formulas");

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            resultWindow.setTitle("Finished searching for "
                    + MZmineCore.getConfiguration().getMZFormat()
                            .format(searchedMass)
                    + " amu, " + foundFormulas + " formulas found");

        }
    });

    setStatus(TaskStatus.FINISHED);

}
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:59,代码来源:SingleRowPredictionTask.java


示例9: getBuilder

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
@Override
public IChemObjectBuilder getBuilder() {
    return bond.getBuilder();
}
 
开发者ID:johnmay,项目名称:efficient-bits,代码行数:5,代码来源:BondRef.java


示例10: getBuilder

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
@Override
public IChemObjectBuilder getBuilder() {
    return atom.getBuilder();
}
 
开发者ID:johnmay,项目名称:efficient-bits,代码行数:5,代码来源:AtomRef.java


示例11: getInChIToStructure

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
/**
 * <p>Gets structure generator for an InChI string.
 * 
 * @param inchi         InChI to generate structure from.
 * @param builder the builder to employ
 * @param options       String of options for structure generation.
 * @return   the InChI structure generator object
 * @throws CDKException    if the generator cannot be instantiated
 */
public InChIToStructure getInChIToStructure(String inchi, 
                                            IChemObjectBuilder builder, 
                                            String options) 
                        throws CDKException {
    return(new InChIToStructure(inchi, builder, options));
}
 
开发者ID:c-ruttkies,项目名称:MetFragRelaunched,代码行数:16,代码来源:InChIGeneratorFactory.java


示例12: calculateIsotopePattern

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
public static IsotopePattern calculateIsotopePattern(
    String molecularFormula, double minAbundance, int charge,
    PolarityType polarity) {

IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();

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

return calculateIsotopePattern(cdkFormula, minAbundance, charge,
	polarity);

   }
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:14,代码来源:IsotopePatternCalculator.java


示例13: IteratingSDFReader

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
/**
 * Constructs a new IteratingMDLReader that can read Molecule from a given a
 * Reader. This constructor allows specification of whether the reader will
 * skip 'null' molecules. If skip is set to false and a broken/corrupted molecule
 * is read the iterating reader will stop at the broken molecule. However if
 * skip is set to true then the reader will keep trying to read more molecules
 * until the end of the file is reached.
 *
 * @param in       the {@link Reader} to read from
 * @param builder  builder to use
 * @param skip     whether to skip null molecules
 */
public IteratingSDFReader(Reader in, IChemObjectBuilder builder, boolean skip) {
    this.builder = builder;
    setReader(in);
    //initIOSettings();
    setSkip(skip);
}
 
开发者ID:ndaniels,项目名称:Ammolite,代码行数:19,代码来源:IteratingSDFReader.java


示例14: run

import org.openscience.cdk.interfaces.IChemObjectBuilder; //导入依赖的package包/类
/**
 * @see java.lang.Runnable#run()
 */
public void run() {

    setStatus(TaskStatus.PROCESSING);

    totalRows = peakList.getNumberOfRows();

    for (PeakListRow row : peakList.getRows()) {

        if (row.getPeakIdentities().length > 0) {
            continue;
        }

        this.ResultingFormulas = new ArrayList<ResultFormula>();

        this.searchedMass = (row.getAverageMZ() - ionType.getAddedMass())
                * charge;

        message = "Formula prediction for " + MZmineCore.getConfiguration()
                .getMZFormat().format(searchedMass);

        massRange = mzTolerance.getToleranceRange(searchedMass);

        IChemObjectBuilder builder = SilentChemObjectBuilder.getInstance();
        generator = new MolecularFormulaGenerator(builder,
                massRange.lowerEndpoint(), massRange.upperEndpoint(),
                elementCounts);

        IMolecularFormula cdkFormula;
        while ((cdkFormula = generator.getNextFormula()) != null) {
            // Mass is ok, so test other constraints
            checkConstraints(cdkFormula, row);

        }

        if (isCanceled())
            return;

        for (ResultFormula f : this.ResultingFormulas) {
            SimplePeakIdentity newIdentity = new SimplePeakIdentity(
                    f.getFormulaAsString());
            row.addPeakIdentity(newIdentity, false);
        }

        finishedRows++;

    }

    if (isCanceled())
        return;

    logger.finest("Finished formula search for all the peaks");

    setStatus(TaskStatus.FINISHED);

}
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:59,代码来源:FormulaPredictionPeakListTask.java



注:本文中的org.openscience.cdk.interfaces.IChemObjectBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AmbiguousTableNameException类代码示例发布时间:2022-05-23
下一篇:
Java IContainerTooltipHandler类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap