本文整理汇总了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;
}
示例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);
}
}
}
}
}
示例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;
}
示例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"));
}
}
示例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;
}
示例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));
}
示例7: clearHydrogens
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
static IAtomContainer clearHydrogens(IAtomContainer container) {
for (IAtom atom : container.atoms())
atom.setImplicitHydrogenCount(0);
return container;
}
示例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;
}