Search in sources :

Example 16 with SLNAtom

use of ambit2.sln.SLNAtom in project ambit-mirror by ideaconsult.

the class SLN2ChemObject method QueryAtomContainerToSLNContainer.

public SLNContainer QueryAtomContainerToSLNContainer(IQueryAtomContainer query) {
    clearAllErrorsAndWarnings();
    SLNContainer slnCon = new SLNContainer(SilentChemObjectBuilder.getInstance());
    for (int i = 0; i < query.getAtomCount(); i++) {
        // SLNAtom slnAtom = (SLNAtom) slnContainer.getAtom(i);
        // IQueryAtom atom = slnAtomToQueryAtom(slnAtom);
        IQueryAtom atom = (IQueryAtom) query.getAtom(i);
        SLNAtom slnAtom = queryAtomToSLNAtom(atom);
        if (currentConversionWarning != null)
            conversionWarnings.add(currentConversionWarning + " for atom: " + (i + 1));
        if (slnAtom == null) {
            conversionErrors.add(currentConversionError + " for atom: " + (i + 1));
            continue;
        }
        slnCon.addAtom(slnAtom);
    // convertedAtoms.put(slnAtom, atom);
    }
    return slnCon;
}
Also used : IQueryAtom(org.openscience.cdk.isomorphism.matchers.IQueryAtom) SLNAtom(ambit2.sln.SLNAtom) SLNContainer(ambit2.sln.SLNContainer)

Aggregations

SLNAtom (ambit2.sln.SLNAtom)10 IAtom (org.openscience.cdk.interfaces.IAtom)9 SLNBond (ambit2.sln.SLNBond)5 SLNContainer (ambit2.sln.SLNContainer)3 SmartsAtomExpression (ambit2.smarts.SmartsAtomExpression)3 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 IBond (org.openscience.cdk.interfaces.IBond)3 IQueryAtom (org.openscience.cdk.isomorphism.matchers.IQueryAtom)3 AnyAtom (org.openscience.cdk.isomorphism.matchers.smarts.AnyAtom)3 AliphaticSymbolQueryAtom (ambit2.smarts.AliphaticSymbolQueryAtom)2 IQueryAtomContainer (org.openscience.cdk.isomorphism.matchers.IQueryAtomContainer)2 QueryAtomContainer (org.openscience.cdk.isomorphism.matchers.QueryAtomContainer)2 SLNExpressionToken (ambit2.sln.SLNExpressionToken)1 ISLNDictionaryObject (ambit2.sln.dictionary.ISLNDictionaryObject)1 AromaticSymbolQueryAtom (ambit2.smarts.AromaticSymbolQueryAtom)1 SmartsExpressionToken (ambit2.smarts.SmartsExpressionToken)1 TopLayer (ambit2.smarts.TopLayer)1 Atom (org.openscience.cdk.Atom)1 AtomContainer (org.openscience.cdk.AtomContainer)1