|
From: Nikolay K. <ni...@un...> - 2015-04-30 10:11:30
|
Hi Yannick On 2015-04-29 22:52, Yannick .Djoumbou wrote: > The SMIRKS Reaction I used was [C;X4:1][H:2]>>[C;X4:1][O][H:2] > > Regards, > > Yannick > > On Wed, Apr 29, 2015 at 1:51 PM, Yannick .Djoumbou > <y.d...@gm...> wrote: > >> Hi Nick, >> >> Thanks for the reply. So, there is no method to directly applying a >> transform at one atom A1. If the smirks contains only one atom within the reactants part, then the reaction is applied only for one atom e.g. [C:1]>>[C:1]=O >> Let's assume the left part of the smirks >> is matched at more than one region R1 and R2 of the molecule. Smarts >> matching could tell me ther are two matches: [A1,A2,A3], and [A4, >> A5, A6]. If I only want the result at for the first match, I should >> be able to submit the list [A1,A2,A3]. If you would like to apply the reaction only for a particular group of atoms you can use applyTransformation(IAtomContainer target, IAcceptable selection, SMIRKSReaction reaction) You have in this function additional input parameter 'selection' which is an implementation of the interface IAcceptable which defines the selected atoms. You have to provide such an implementation of IAcceptable. >> Is there a way to apply >> verify the other elements such as topology, etc... and generate the >> product based on transforming the molecule at the site [A1,A2,A3]. >> The topology check and all other checks are done by the SMIRKSManager internally: It performs substructure searching and finds all corrects locations (mappings) which correspond to the target SMIRKS string then you have various strategies concerning these found locations e.g. handling of overlapping, selected locations as mentioned above etc. If you want to directly tell at which location to apply reaction via calling applyTransformAtLocation(IAtomContainer target, List<IAtom> rMap, SMIRKSReaction reaction), then the rMap must be correct and you have to do it youself outside SMIRKSManager. But generally it is not needed since all this is done by the SMIRKSManager. Best regards Nick >> Regards, >> >> Yannick >> >> On Wed, Apr 29, 2015 at 12:09 AM, Nikolay Kochev >> <ni...@un...> wrote: >> >> Hi Yannick >> >> On 4/28/15 10:01 PM, Yannick .Djoumbou wrote: >> >> Hi all, >> >> I am using the function applyTransformAtLocation to transform >> molecules at a specific location. >> >> IAtomContainer ac = sp.parseSmiles(CC1CCC(CN)OC1); >> Vector<IAtom> va = new Vector<IAtom>(); >> va.add(ac.getAtom(1)); >> System.out.println(va); >> smrkMan.applyTransformAtLocation(ac,va,reaction); >> >> Typically function applyTransformAtLocation() is not expected to be >> called directly. Mainly it is used internally by SMIRKSManager. >> >> In order to use it correctly you must sent to it exact information >> for the atoms which are to be transformed. Internally this is done >> by the SMARTS mapping which defines all locations correctly. >> >> Particular location is defined not by one atom, but by all "mapped" >> atoms from the SMARTS searching. >> All reactant atoms and their topology (the left part of the smirks) >> must be represented correctly within the location description >> >> In the case above, your location (Vector<IAtom> va) is described by >> only one atom and I suppose that the smirks contains more atoms so >> that is the error: Array index out of range: 1. >> But even the atom count is made ok, then the topology, atoms types >> etc may be done not ok. That is why you have no reason to use this >> function directly except you know what are you doing. >> >> I hope this helps >> >> Best regards >> Nick >> >> This results in an error: >> >> [Atom(1002243760, S:C, H:0, AtomType(1002243760, N:C.sp3, >> MBO:SINGLE, BOS:4.0, FC:0, H:SP3, NC:4, EV:4, Isotope(1002243760, >> Element(1002243760, S:C, AN:6))))] >> >> Exception in thread "main" >> java.lang.ArrayIndexOutOfBoundsException: Array index out of range: >> 1 >> at java.util.Vector.get(Vector.java:744) >> at >> > ambit2.smarts.SMIRKSManager.applyTransformAtLocation(SMIRKSManager.java:596) >> >> Regards, >> >> Yannick |