I have a list of target molecules and a query molecule with say two R-groups defined. Now I want to find out if each of my structures matches the query and if it does get an array (or collection) of two Molecule objects representing the ligands. Could you give me some hints how to do this using the RGroupDecomposition API?
ChemAxon fb166edcbd
08-09-2005 21:54:53
The RGroupDecomposition API returns matching ligands in
http://www.chemaxon.com/jchem/doc/api/chemaxon/sss/search/RGroupDecomposition.html#findLigands(int[]).
But this molecule array maps each query atom to a Molecule object, either one of the R-group ligands, or the scaffold, depending on the query atom. The R-group indexes of the query atoms can be easily determined anyway, but it is also returned in
getQueryRMap().
Now, the ligand molecule array contains the scaffold at each index for which the query R-map is 0 (non-R-group node) and contains the corresponding R-group ligand at each index for which the query R-map is non-zero (R-group node).
I attach sample code that demostrates how to fetch the R-group ligands according to the above ideas. Example run (the map numbers represent corresponding R-group attachment points):
Code: |
java RGDecompTest query.mol targets.sdf
Oc1cc(cc(C2CCC(Br)CC2)c1Cl)C3CCCC3
[OH2:1].C1CC[CH2:2]C1
BrC1CC[CH2:1]CC1.C1CC[CH2:2]C1
NCc1ccc(Cl)c(Oc2cc(cc(C3CCC(Br)CC3)c2Cl)C4CCCC4)c1
NCc1ccc(Cl)c(c1)[OH:1].C1CC[CH2:2]C1
BrC1CC[CH2:1]CC1.C1CC[CH2:2]C1
Clc1c(cc(cc1[OH:1])C2CCCC2)C3CCC(Br)CC3.N[CH3:2]
[H+:1].N[CH3:2]
|
Since now I see that this behaviour may be not very user-friendly, I am planning to add some other get-method to get the ligands.
It can be either a method that returns the ligands for a given R-group index or the same findLigands() method but setting null entries in place of scaffold structures. To return the R-group ligands in an array is not a good idea because then we do not know which ligand coresponds to which R-group. Any suggestions are welcome.
Given a target molecule and a query mol, we would like to color the
target molecule so that the scaffold is displayed in blue, R1 in red and R2 in green.
Could you show us how that can be accomplished via your API? (basically we not only want to know what R1 is, but also where it is located in the original target molecule)
ChemAxon fb166edcbd
09-09-2005 10:31:22
User 10a23c54c1
12-09-2005 00:58:31
What will be the easiest way of generating actual images with R-groups colored. For instance a search is performed against a list of target molecules with a query molecule consisting of two R-groups. The final result should be a list of say png images of target molecules but with R1s colored in red and R2s in green. It will be helpful if there is a working sample code for this.
Thanks
Hayk
User 10a23c54c1
12-09-2005 01:01:39
One more question: given an array of atom indexes of a molecule, is there an easy way to create a 'sub-molecule' consisting only of atoms with indexs in the input array?
ChemAxon fb166edcbd
09-12-2005 00:29:05
I have added 3 more methods to the RGroupDecomposition API,
these will be included in the next major JChem release (JChem 3.2).
This creates a single ligand or scaffold molecule for a given ligand ID (query R-group or scaffold atom index), without producing all ligand molecules. The implementation selects the target atoms contained in the specified ligand / scaffold and removes all other atoms from the target.
Code: |
/**
* Returns the target submolecule corresponding to a ligand or scaffold.
* The submolecule is part of the cloned target, not the original one.
* @param ligandId is the ligand ID: the least attachment query rgroup atom index
* corresponding to a ligand attachment,
* <code>-1</code> for scaffold
* (a member of the 'ligandIds' array)
* @param hit is the search hit
* @param ligandIds is the ligand ID array returned by {@link #findLigandIds(int[])}
* @return the submolecule, <code>null</code> for invalid ligandId
* @since JChem 3.2
*/
public Molecule findLigand(int ligandId, int[] hit, int[] ligandIds);
|
These two methods determine the ligand ID(s) corresponding to a given R-group index. That is, maps the R-group index to the corresponding query atom index(es). You can use these methods to get the ligand ID to be set in the above findLigand() method.
Code: |
/**
* Returns the ligand IDs (the least attachment R-group query indexes)
* corresponding to a given R-group index.
* This is only one ID (wrapped in a one-length array), except when
* there are more R-group nodes with the same R-group index in the query
* (e.g. there are two R1 nodes).
* @param rindex is the R-group index
* (e.g. <code>1</code> for R1, <code>2</code> for R2)
* @param hit is the search hit
* @param ligandIds is the ligand ID array returned by {@link #findLigandIds(int[])}
* @return the corresponding ligand IDs,
* an empty array if there is no r-group with the given 'rindex'
* @since JChem 3.2
*/
public int[] getLigandIds(int rindex, int[] hit, int[] ligandIds);
/**
* Returns the ligand ID (the attachment R-group query index)
* corresponding to a given R-group index.
* Use {@link #getLigandIds(int, int[], int[])} if there are more R-group nodes
* with the same R-group index in the query (e.g. there are two R1 nodes).
* @param rindex is the R-group index
* (e.g. <code>1</code> for R1, <code>2</code> for R2, <code>0</code> for scaffold)
* @param hit is the search hit
* @param ligandIds is the ligand ID array returned by {@link #findLigandIds(int[])}
* @return the corresponding ligand ID, <code>-1</code> if 'rindex' is <code>0</code>
* (scaffold) or <code>-2</code> if there is no r-group with the given 'rindex'
* @since JChem 3.2
*/
public int getLigandId(int rindex, int[] hit, int[] ligandIds);
|
I attach some test code but it will run only from JChem 3.2.
Here is a sample run:
Code: |
java RGDecompMolTest q.mol t.smiles
|
The result printout is in output.txt (attached).
Is this API extention appropriate for you?