Dear All,
The following codes are used to produced the largest MCS between two
molecules:
---Code snippets starts---
MDLV2000Reader q_reader = new MDLV2000Reader(new FileReader(new
File(queryMol)));
ChemFile chemFile = (ChemFile)q_reader.read((ChemObject)new
ChemFile());
List<IAtomContainer> containersList =
ChemFileManipulator.getAllAtomContainers(chemFile);
IAtomContainer q_container = containersList.get(0);
q_container = AtomContainerManipulator.removeHydrogens( q_container
);
MDLV2000Reader t_reader = new MDLV2000Reader(new FileReader(new
File(targetMol)));
chemFile = (ChemFile)t_reader.read((ChemObject)new ChemFile());
containersList = ChemFileManipulator.getAllAtomContainers(chemFile);
IAtomContainer t_container = containersList.get(0);
t_container = AtomContainerManipulator.removeHydrogens( t_container
);
List<IAtomContainer> mcsslist =
UniversalIsomorphismTester.getOverlaps( q_container, t_container );
int maxmcss = -9999999;
IAtomContainer maxac = null;
for (int i = 0; i < mcsslist.size(); i++){
IAtomContainer a = (IAtomContainer)mcsslist.get(i);
if (a.getAtomCount() > maxmcss) {
maxmcss = a.getAtomCount();
maxac = a;
}
}
---Code snippets ends---
After that, UniversalIsomorphismTester.getSubgraphAtomsMap() is run for
atomic indices of MCS in query molecule or target molecule.
---Code snippets starts---
int[][] aQTResult = new int[ maxmcss ][ 2 ];
List<RMap> llq = UniversalIsomorphismTester.getSubgraphAtomsMap(
q_container, maxac );
if( llq == null ) return aQTResult;
int count = 0;
for( RMap rmap: llq ) {
aQTResult[ count++ ][ 0 ] = rmap.getId1();
}
List<RMap> llt = UniversalIsomorphismTester.getSubgraphAtomsMap(
t_container, maxac );
if( llt == null ) return aQTResult;
count = 0;
for( RMap rmap: llt ) {
aQTResult[ count++ ][ 1 ] = rmap.getId1();
}
---Code snippets ends---
An exact mapping sets between query and target molecules are required for
further procession. It is found that the indices are messed up.
An excellent site http://rguha.net/code/java/ is found for the
implementation. Would anybody can help me out for that?
A query molecule BindingDB_2579.mol and a target molecule LigandDepo.mol are
enclosed for your testing.
Thank you in advance!
Tiqing Liu
LigandDepot.mol
Description: Binary data
BindingDB_2579.mol
Description: Binary data
------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference
_______________________________________________ Cdk-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cdk-user

