hi,

read the molecules first into a SetOfMolecules and than iterate over this:
for (int i=0; i<setOfMolecules.getAtomcontainerCount();i++){
     if (i !=2 ){
          compare;
      }
}

this works fine if setOfMolecules <= 20000.

hope this helps
Christian
-------- Original-Nachricht --------
Datum: Thu, 13 Jul 2006 18:30:53 +0530
Von: Om <[EMAIL PROTECTED]>
An: cdk-user <[email protected]>
Betreff: [Cdk-user] IteratingMDLReader

> Hi,
> 
> How do I read sdf file in a indexed way using CDK IteratingMDLReader?
> Meaning: Suppose I have SDF file of 5 Molecules. I want to compare 2nd
> Molecule with say 1st, 3rd and 5th Molecule. Some thing like
> 'ListIterator'
> of the java.util
> 
> Is there any way pass to numerical index to next() object of
> IteratingMDLReader [say like mol_query = (Molecule) myiter.next(int 5)];
> 
> Code Snippet of unsuccessful attempt :(
> ------------------------
> sdfile= new BufferedReader (new FileReader(new File("test.sdf")));
> IteratingMDLReader myiter = new IteratingMDLReader(sdfile,
> DefaultChemObjectBuilder.getInstance());
> 
> Molecule mol_target = null;
> Molecule mol_query = null;
> HydrogenAdder ha = new HydrogenAdder();
> Fingerprinter fprinter = new Fingerprinter(length, depth);
> while (myiter.hasNext())
> {
>        mol_target = (Molecule) myiter.next();
>    ha.addExplicitHydrogensToSatisfyValency(mol_target);
>         fp_target = fprinter.getFingerprint(mol_target);
> 
>        for (index_query=1; myiter.hasNext(); ++index_query)
>        {
>        mol_query = (Molecule) myiter.next();
>        ha.addExplicitHydrogensToSatisfyValency(mol_query);
>        fp_query = fprinter.getFingerprint(mol_query);
>        //
>        }
> }
> -----------------------
> 
> Any help would be highly appreciated
> Thanks
> 
> 
> Om Prakash
> Research Student,
> Bioinformatics Center
> University of Pune
> Pune-411007
> India

-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to