Exemplo n.º 1
0
  public boolean checkIsomorphismAtPosition(IAtomContainer container, int atomNum) {
    if ((atomNum < 0) || (atomNum >= container.getAtomCount())) return false;

    target = container;
    FlagStoreIsomorphismNode = false;
    isomorphismNodes.clear();

    if (query.getAtomCount() == 1) {
      SMARTSAtom qa = (SMARTSAtom) query.getAtom(0);
      return qa.matches(target.getAtom(atomNum));
    }

    TopLayer.setAtomTopLayers(target, TopLayer.TLProp);

    executeSequenceAtPos(atomNum);
    if (isomorphismFound) return true;

    return false;
  }
Exemplo n.º 2
0
  public List<Integer> getIsomorphismPositions(IAtomContainer container) {
    target = container;
    FlagStoreIsomorphismNode = false;
    isomorphismNodes.clear();

    List<Integer> v = new ArrayList<Integer>();
    if (query.getAtomCount() == 1) {
      SMARTSAtom qa = (SMARTSAtom) query.getAtom(0);
      for (int i = 0; i < target.getAtomCount(); i++) {
        if (qa.matches(target.getAtom(i))) v.add(new Integer(i));
      }
      return (v);
    }

    TopLayer.setAtomTopLayers(target, TopLayer.TLProp);
    for (int i = 0; i < target.getAtomCount(); i++) {
      executeSequenceAtPos(i);
      if (isomorphismFound) v.add(new Integer(i));
    }
    return (v);
  }