On Tue, Mar 3, 2009 at 11:14 AM, Vincent Le Guilloux
<vincent.le-guill...@univ-orleans.fr> wrote:
> First of all, the 2D depiction seems to be slightly broken: sometimes
> two atoms overlap, making one of them disapearing (it can be seen when
> resizing the Jtable column for example). Anyone knows about that? Is
> the code bellow up to date? Should I use any other class etc. ?

Please attach screenshots.

> Next, how does the generation of 2D coordinates works when 2D
> coordinates are already set? (ie. Z = 0) There is nothing in the
> documentation about that.

Just delete the original 2D coordinates first:

for (IAtom atom : molecule.atoms()) atom.setPoint2d(null);

> Also, I found the way to read MDL quite complex, at least in
> appearance.

See below.

> Besides, I've been told that this code is not intended to
> be run on a large dataset.

For large sets you can best use the IteratingMDLReader, but I do not
think JTable supports caching, so you will run out of memory there
before reading the MDL will be a problem, I think.

> In my program, I will have to load a huge set of molecule, and 500 of
> them will be displayed in a JTable as described bellow... I haven't
> tested yet to open such a number of molecules, so I was wondering if
> there could be any performance issue using the following 2D
> depiction/drawing code and MDL reading? And if so, if there is any way
> to improve it?

Use a table widget that support caching... that is, that only keeps in
memory the things that it depicts at that time.

> Finally, I will have to display 3D molecules too. Currently, It
> appears the CDK alone can't do that, to I guess I've to check JMol,

(lower case 'm', if you mean Jmol at jmol.org; JMol is a smaller but
existing viewer too)

> and I just wanted to confirm that ;)

Yes.

BTW, alternatively, you could consider Bioclipse, which is already
doing much of what you wrote down here. Not sure where you're end goal
is, but Bioclipse is an excellent end-user platform, where the CDK is
just a library with cheminformatics functionality.

> Ok that will be it for now. Sorry for all those questions... And many
> thanks in advance for your answers.

No worries.

> ************
> MDL reading
> ************
>
> MDLV2000Reader reader = new MDLV2000Reader(new StringReader(v)) ;
> ChemFile chemFile = (ChemFile) reader.read(new ChemFile());
> IChemModel model = chemFile.getChemSequence(0).getChemModel(0);
> model.getMoleculeSet().getAtomContainer(0) ;

The MDLV2000Reader supports direct reading of an IMolecule (or the
superclass IAtomContainer) too (for any IChemObjectReader, you can
test this with the accepts() method), so you can simplify the code
into:

MDLV2000Reader reader = new MDLV2000Reader(new StringReader(v)) ;
IMolecule mol = (IMolecule reader.read(new Molecule());

Egon

-- 
Post-doc @ Uppsala University
http://chem-bla-ics.blogspot.com/

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to