Hi Pascal,

Ah. After a bit of testing, and looking at the IteratingSmilesReader
code, it seems like you actually need:

mol.getProperty(CDKConstants.TITLE)

as that is what the IteratingSMILESReader is doing. It would be great
if you could file a feature request:

http://sourceforge.net/tracker/?group_id=20024&atid=370024

for the SMILESReader to do the same thing as the Iterating one.
Personally I think that CDKConstants.TITLE is better than SMIdbNAME
(which is easy to mis-type).

As for your other question - "what is the difference between IMolecule
and Molecule?" - the first is an interface, and the second an
implementation of that interface. So it is possible to have
DebugMolecule and NoNotificationMolecule (which exist in the CDK) or
some strange custom MyLiveDatabaseConnectionMolecule if you like.

Code that manipulates molecules - assuming they use the interface -
can hopefully work on any of these implementations, with minimal or no
changes.

gilleain

On Thu, Sep 30, 2010 at 10:50 AM, Pascal Muller
<[email protected]> wrote:
> Hi again,
>
> I progressed a bit in my code, and now I would like to print the
> molecule name. But the following code only prints "null"... Anybody
> could tell me where I am wrong? Thanks!
>
> Input smiles: tmp.smi:
> CCCNCC1=CC(CC2CC2)=CC=C1 molec1
> CCCNCc1cccc(CC2CC2)c1 molec2
>
> Code below.
> Regads,
> Pascal
>
>
> public class ex2 {
>        public static void main(String args[]) throws Exception {
>                GenerateFragments gf=new GenerateFragments();
>                boolean bol = true;
>                IteratingSMILESReader reader = new IteratingSMILESReader(new
> FileInputStream("tmp.smi"));
>                while(reader.hasNext()){
>                        IMolecule mol = (IMolecule)reader.next(); //
> What is the difference of "Molecule" with "IMolecule"?
>                        System.out.println(mol.getProperty("SMIdbNAME")); // 
> print only "null"
>                        gf.generateMurckoFragments(mol,bol,bol,3);
>                        String[] smiles=gf.getMurckoFrameworksAsSmileArray(); 
> // still
> aromatic / saturated problem
>                        System.out.println(smiles[0]);
>                }
>        }
> }
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Cdk-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to