本文整理汇总了Java中org.openscience.cdk.interfaces.IAtomContainer.addAtom方法的典型用法代码示例。如果您正苦于以下问题:Java IAtomContainer.addAtom方法的具体用法?Java IAtomContainer.addAtom怎么用?Java IAtomContainer.addAtom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openscience.cdk.interfaces.IAtomContainer
的用法示例。
在下文中一共展示了IAtomContainer.addAtom方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStructureAsAromaticIAtomContainer
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的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;
}
示例2: getStructureAsIAtomContainer
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的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;
}
示例3: 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;
}
示例4: computeInitialIteration
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private void computeInitialIteration() throws MoltyperException, FingerPrinterException{
for (IAtom atom : this.molecule.atoms()) {
IAtomContainer substructure = new AtomContainer();
substructure.addAtom(atom);
ECFPVariantFeature ecfpFeature = new ECFPVariantFeature(this, molecule, atom, substructure,
this.generateExtensionBondList(atom), this.currentIteration,this.getAtomLabel(atom).hashCode(),null);
this.hashedAtomLabels.put(atom, ecfpFeature.hashCode());
this.featuresOfLastIteration.put(atom, ecfpFeature);
this.completeFeatures.add(ecfpFeature);
}
}
示例5: computeInitialIdentifiers
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private void computeInitialIdentifiers() throws FingerPrinterException, MoltyperException{
for(IAtom atom: molecule.atoms()){
IAtomContainer substructure = new AtomContainer();
substructure.addAtom(atom);
for(IBond bond: molecule.getConnectedBondsList(atom)){
substructure.addBond(bond);
}
//System.out.println("initial "+this.getAtomLabel(atom)+",id="+this.getAtomLabel(atom).hashCode());
ECFPFeature ecfpFeature = new ECFPFeature(this, molecule, atom, substructure,this.iteration,this.getAtomLabel(atom).hashCode(), null);
this.featuresOfLastIteration.put(atom, ecfpFeature);
completeFeatures.add(ecfpFeature);
}
}
示例6: getNonDeepCloneOfSubstructure
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
public IAtomContainer getNonDeepCloneOfSubstructure(){
IAtomContainer clone = new AtomContainer();
for(IBond bond: this.substructure.bonds())
clone.addBond(bond);
for(IAtom atom: this.substructure.atoms())
clone.addAtom(atom);
return clone;
}
示例7: sproutHydrogen
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private IAtom sproutHydrogen(IAtomContainer mol, IAtom focus)
{
IAtom hydrogen = mol.getBuilder().newAtom();
hydrogen.setAtomicNumber(1);
hydrogen.setSymbol("H");
hydrogen.setImplicitHydrogenCount(0);
mol.addAtom(hydrogen);
mol.addBond(mol.indexOf(focus), mol.getAtomCount() - 1, IBond.Order.SINGLE);
return hydrogen;
}
示例8: computeIterationForAtom
import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private ECFPVariantFeature computeIterationForAtom(IAtom atom) throws FingerPrinterException, MoltyperException {
final ECFPVariantFeature oldFeature = this.featuresOfLastIteration.get(atom);
final IAtomContainer newSubstructure = oldFeature.getNonDeepCloneOfSubstructure();
final int numDanglingBonds = oldFeature.numberOfDanglingBonds();
final List<BondOrderIdentifierTupel> connections = new ArrayList<BondOrderIdentifierTupel>(numDanglingBonds);
final Map<IBond, DanglingBond> newConnectionCandidates = new HashMap<IBond, DanglingBond>();
for (int i = 0; i < numDanglingBonds; i++) {
final DanglingBond connection = oldFeature.getDanglingBond(i);
final IAtom connectedAtom = connection.getBond().getAtom(connection.getConnectedAtomPosition());
final int identifierOfConnectedAtom = this.hashedAtomLabels.get(connectedAtom);
newSubstructure.addAtom(connectedAtom);
newSubstructure.addBond(connection.getBond());
final BondOrderIdentifierTupel boIDtupel=Encoding2DECFP.getNewBondOrderIdentifierTupel(this.getBondOrder(connection.getBond()), identifierOfConnectedAtom);
connections.add(boIDtupel);
final ArrayList<DanglingBond> newConnections = this.getConnectionsOfAtom(connection.getBond(), connectedAtom);
for (final DanglingBond dbond : newConnections) {
if (!newConnectionCandidates.containsKey(dbond.getBond())) {
newConnectionCandidates.put(dbond.getBond(), dbond);
}
}
}
final Iterator<DanglingBond> iter = newConnectionCandidates.values().iterator();
while (iter.hasNext()) {
final DanglingBond bondToCheck = iter.next();
if (newSubstructure.contains(bondToCheck.getConnectedAtom())) {
if (!newSubstructure.contains(bondToCheck.getBond())) {
newSubstructure.addBond(bondToCheck.getBond());
}
iter.remove();
}
}
final DanglingBond[] newDanglingBonds = newConnectionCandidates.values().toArray(
new DanglingBond[newConnectionCandidates.size()]);
final ECFPVariantFeature newFeature = new ECFPVariantFeature(this, molecule, atom, newSubstructure, newDanglingBonds,
this.currentIteration,oldFeature.hashCode(), connections);
this.featuresOfLastIteration.put(atom, newFeature);
return newFeature;
}