当前位置: 首页>>代码示例>>Java>>正文


Java IAtomContainer.atoms方法代码示例

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


在下文中一共展示了IAtomContainer.atoms方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeIterationForAtom

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private ECFPFeature computeIterationForAtom(IAtom atom) throws FingerPrinterException, MoltyperException{
	ECFPFeature oldFeature = featuresOfLastIteration.get(atom);
       IAtomContainer newSubstructure = oldFeature.getNonDeepCloneOfSubstructure();
	List<BondOrderIdentifierTupel> connectivity = new ArrayList<BondOrderIdentifierTupel>();

	for(IAtom connectedAtom: molecule.getConnectedAtomsList(atom)){
		int identifierOfConnectedAtom = featuresOfLastIteration.get(connectedAtom).hashCode();
		//System.out.println("iterate "+connectedAtom.getAtomTypeName()+",id="+identifierOfConnectedAtom+",id="+featuresOfLastIteration.get(connectedAtom).featureToString(true));
		connectivity.add(new BondOrderIdentifierTupel(this.getBondOrder(molecule.getBond(atom,connectedAtom)),identifierOfConnectedAtom));
           IAtomContainer structure = this.featuresOfLastIteration.get(connectedAtom).representedSubstructure();
		for(IAtom a: structure.atoms()){
			if(!newSubstructure.contains(a))
				newSubstructure.addAtom(a);
		}
		for(IBond b: structure.bonds()){
			if(!newSubstructure.contains(b))
				newSubstructure.addBond(b);
		}
	}
	
	ECFPFeature newFeature = new ECFPFeature(this, molecule, atom, newSubstructure, this.iteration,oldFeature.hashCode(), connectivity);
	return newFeature;
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:24,代码来源:Encoding2DECFP.java

示例2: lipophilicCarbonAnnotation

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private void lipophilicCarbonAnnotation(HashMap<Integer, Vector<PotentialPharmacophorePoint>> PPPAssignment,
		IAtomContainer mol) {
	// First create the PPP object
	final PotentialPharmacophorePoint ppp = new PotentialPharmacophorePoint("L", "No SMARTS available",
			"Carbon atoms only adjacent to carbon atoms");

	for (final IAtom a : mol.atoms()) {
		if (a.getAtomicNumber() == 6) {
			// Check if all neighbors are carbon atoms
			if (this.neighborsCarbonAtom(mol, a)) {
				// Append entry to the HashMap
				if (!PPPAssignment.containsKey(mol.getAtomNumber(a))) {
					final Vector<PotentialPharmacophorePoint> temp = new Vector<PotentialPharmacophorePoint>();
					temp.add(ppp);
					PPPAssignment.put(mol.getAtomNumber(a), temp);
				} else {
					PPPAssignment.get(mol.getAtomNumber(a)).add(ppp);
				}
			}
		}
	}
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:23,代码来源:PharmacophorePointAssigner.java

示例3: addExplicitHydrogens

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
/**
 * add hydrogens
 * 
 * @param mol
 * @throws CDKException
 */
private static IAtomContainer addExplicitHydrogens(IAtomContainer mol) throws CDKException{

	CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(mol.getBuilder());
	for (IAtom atom : mol.atoms()) {
	     IAtomType type = matcher.findMatchingAtomType(mol, atom);
	     try{
	    	 AtomTypeManipulator.configure(atom, type);
	     }
	     catch(IllegalArgumentException e){
	    	 throw new CDKException(e.toString()+" for atom "+atom.getAtomicNumber()+" "+atom.getSymbol());
	     }
	   }
	CDKHydrogenAdder hydrogenAdder = CDKHydrogenAdder.getInstance(mol.getBuilder());
	hydrogenAdder.addImplicitHydrogens(mol);
	AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol);

	return mol;

}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:26,代码来源:MoleculePreprocessor.java

示例4: annotateCip

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private void annotateCip(IAtomContainer part)
{
  CdkLabeller.label(part);
  for (IAtom atom : part.atoms()) {
    if (atom.getProperty("cip.label") != null)
      atom.setProperty(StandardGenerator.ANNOTATION_LABEL,
                       StandardGenerator.ITALIC_DISPLAY_PREFIX + atom.getProperty("cip.label"));
  }
  for (IBond bond : part.bonds()) {
    if (bond.getProperty("cip.label") != null)
      bond.setProperty(StandardGenerator.ANNOTATION_LABEL,
                       StandardGenerator.ITALIC_DISPLAY_PREFIX + bond.getProperty("cip.label"));
  }
}
 
开发者ID:cdk,项目名称:depict,代码行数:15,代码来源:DepictController.java

示例5: process

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
@Override
void process(IAtomContainer mol) {
    long t0 = System.nanoTime();
    boolean[] visit = new boolean[mol.getAtomCount()];
    for (IAtom atom : mol.atoms()) {
        final int idx = mol.getAtomNumber(atom);
        if (!visit[idx]) {
            visit[idx] = true;
            dfs(visit, mol, atom, null);
        }
    }
    long t1 = System.nanoTime();
    tRun += t1 - t0;
}
 
开发者ID:johnmay,项目名称:efficient-bits,代码行数:15,代码来源:Benchmark.java

示例6: main

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException, CDKException {

    if (args.length < 1 || !args[0].endsWith(".sdf")) {
        System.err.println("Expected input SDF as argument.");
        return;
    }
    
    if (args[0].startsWith("~"))
        args[0] = System.getProperty("user.home") + args[0].substring(1);
    
    String sdfInPath  = args[0];
    String sdfOutPath = sdfInPath.substring(0, sdfInPath.length() - 4) + "-templates.sdf";
    
    System.out.println("Extracting ring templates to '" + sdfOutPath + "'");
    System.out.println(" - input SDfile: '" + sdfInPath + "'");

    RingTemplateExtractor extractor = new RingTemplateExtractor();

    IteratingSDFReader sdfReader = new IteratingSDFReader(new FileReader(sdfInPath),
                                                          SilentChemObjectBuilder.getInstance());
    SDfile:
    while (sdfReader.hasNext()) {

        IAtomContainer container = sdfReader.next();            
        
        if (container instanceof IQueryAtomContainer)
            continue;

        for (IAtom atom : container.atoms()) {
            if (atom.getImplicitHydrogenCount() == null)
                continue SDfile;
            if (atom.getPoint2d() == null)
                continue SDfile;
        }

        extractor.add(container);
    }
    
    extractor.writeSDfile(new File(sdfOutPath));
}
 
开发者ID:cdk,项目名称:cdk-build-util,代码行数:41,代码来源:ExtractTemplates.java

示例7: clearHydrogens

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
static IAtomContainer clearHydrogens(IAtomContainer container) {
    for (IAtom atom : container.atoms())
        atom.setImplicitHydrogenCount(0);
    return container;
}
 
开发者ID:cdk,项目名称:cdk-build-util,代码行数:6,代码来源:RingTemplateExtractor.java

示例8: allCarbon

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
static boolean allCarbon(IAtomContainer container) {
    for (IAtom atom : container.atoms())
        if (!"C".equals(atom.getSymbol()))
            return false;
    return true;
}
 
开发者ID:cdk,项目名称:cdk-build-util,代码行数:7,代码来源:RingTemplateExtractor.java


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