Pages

Thursday, June 18, 2009

Bioclipse-JChemPaint

The Uppsala and EBI CDK-teams have been working hard on finishing the rewrite of JChemPaint I started with Niels earlier. While the EBI-team focused on the applet (and Swing application), the Uppsala team, obviously, focused on the SWT side, for integration into Bioclipse. The new JChemPaint is reaching a useful state, and below is a quick update screenshot something Arvid has been working on:

It shows a periodic table which allows you to drag any element type onto the JChemPaint drawing area. It is using regular drag and drop functionality, allowing you to create any arbitrary pseudo atom too. This also paves the way for a template system, allowing you to drag-n-drop fragments onto an active JChemPaint editor.

19 comments:

  1. Egon, I'm trying to find time to write about commercial vs open source structure editors. I sat in on the Symyx Draw presentation today. I'm very impressed by where Symyx has taken this package. Their add-in functionality is very complete. It's also free for academics and home use. So is ChemSketch. So is Marvin. In fact there are so many excellent structure editors out there and the companies would likely grant the right to integrate and even help make it happen. I'm just wondering why build another one? I know it's Open Source etc but is that the only reason?

    ReplyDelete
  2. @ChemSpiderMan: Interoperability can be a problem with commercial software. Try copying from SymyxDraw and pasting into Chem3D. Or let's say you have a database of structures saved in .skc format, and you want to do QSAR...? (I know of a case like this in a company)

    ReplyDelete
  3. Hi - my name is James Jack - a consultant working for Symyx. I hope you don't mind me contributing here.

    I have to agree a little with the first comment about clipboard interactions in general, but Symyx Draw puts data on the clipboard in several formats at once: these formats are published and at very least Chem3D should be able to use a molfile. If Chem#D read the clipboard appropriately it could identify the source of the data as Symyx Draw and know what to do with the data. I don't have Chem3D, but if it has an api that can allow you to interact with the Windows Clipboard then I could show you how to make this work by addition a "paste from Symyx Draw" menu in Chem3D or even a "copy to clipboard for Chem3D" menu inside Symyx Draw (for me this would be easier - I just need to know the required clipboard format)

    On the second point: Symyx Draw 3.2 added a new feature called SketchStrings: these are binary sketch files encoded in base 64 to allow easy storage in a database as CLOB or for inclusion in a web page. There is a special tag to allow them to be rendered using the Symyx Draw renderer component. Along with this, when you open a binary sketch (*.skc) in Symyx Draw you can generate a "Molecule" object which not only contains all of the Sketch file features and can be rendered, but also contains a molfilestring object: this is the chemistry with all the none chemical objects stripped away. You can also pull out SMILES if you need to. Thus it would be trivial to write an application which took a bunch of sketch files either from a database or from a folder on your hard drive and from them generate input files for QSAR in either SMILES or molfile format. Extend this with openBabel and you could get the data in whatever format you need (assuming SMILES or molfile are no good). I suspect I could write such an application in less that 50 lines of code.

    ReplyDelete
  4. @James Jack: I appreciate the detailed reply. "Paste MOL from clipboard" and "Copy MOL to clipboard" would be great additions to all 2D drawing packages. This would make it easy to develop interoperable applications. Not all commercial developers are willing to spend time to integrate OSRA into their own packages, for example (nice work BTW).

    Regarding writing an application to convert from .skc to other formats, OpenBabel would certainly welcome code for reading/writing basic .skc objects.

    ReplyDelete
  5. @baoilleach: As, I suspect, you are a non commercial user - you can download Symyx Draw for free. You only need register with on symyx.com. If you like .Net programming (as I do) then I can send you some sample code to show how you might churn a bunch sketch files into more open formats. For instance into an SDFile. I could also show you how easy it is to create an addin for the kind of clipboard functionality you would need to work with Chem3D or possibly other tools.

    Is there a way we can trade email addresses on here without the risk of being spammed?

    ReplyDelete
  6. Sounds interesting. I'm at baoilleach@gmail.com.

    ReplyDelete
  7. @Tony, the problem isn't so much lack of software, but the need for software that works well in a particular setting under a very specific set of technical and legal constraints.

    ChemDraw and ISIS/Draw are great for desktop applications. But they fall flat on the open Web, where you never know what hardware/OS/Browser your clients have installed, or even if those users can install the plugins needed to get things working. Or if those users can afford the version of the drawing software your plugin needs. And so on...

    ChemWriter was a response to the need for a structure editor designed from the ground up with Web applications in mind. It loads in a second or two, won't pop up any scary security warnings, won't freeze in the middle of a drawing operation to load additional modules, has a user interface designed to make structure drawing in Web pages more efficient, requires nothing other than a Web browser and the ubiquitous Java plugin, and is known to work on all modern OS/browser/hardware combinations.

    But as a component in a desktop application like Bioclipse, it would be a poor choice, mainly because of the features it leaves out to work well on the Web.

    The unavoidable need to deal with these technical tradeoffs creates the need (and opportunity) to solve the structure editor problem from a variety of perspectives.

    The open source community has its own set of constraints (technical and legal) that makes these projects a poor match for most, if not all, commercial products.

    In other words, the characteristics that make an editor work well in one setting are often the same characteristics that will keep it from working well in another.

    @James - I second Noel's request for copy/past molfile.

    ReplyDelete
  8. @Rich: Have you tried the Symyx JDraw applet used for the RSC InChI Resolver. That was the BETA release. The final release works natively with the windows clipboard and supports stuff like multiple undo / repeat. Well worth a look if you haven't tried it yet.

    I also renders grids of structures well.

    ReplyDelete
  9. This is an interesting exchange. Thanks for participating.

    Noel: Interoperability with commercial software doesn't have to be a problem at all. The majority of vendors allow integration now. James has discussed it. ACD/Labs offer Chembasic: http://www.acdlabs.com/products/chem_dsn_lab/chembasic/. ChemAxon are flexible etc. They are generally willing to help.

    Rich: Agreed that the needs depend on the environment. I like ChemWriter. That's Closed SOurce though right? My question was when why write the Open SOurce applications. In terms of having the right tools for the environment we've used Symyx JDraw on the web and it works fine. Loads quickly and has a lot of the strong underpinnings of Symyx Draw of course.

    I'm not particularly biased one way or another..just looking for good, easy drop-in solutions with good support and longevity. I thought this way when we were ChemSpider as ChemSpider and not ChemSpider as RSC.

    So, my question Rich was "I'm just wondering why build another one? I know it's Open Source etc but is that the only reason?" and I think you're pointing to "the need for software that works well in a particular setting under a very specific set of technical and legal constraints." Understood.

    ReplyDelete
  10. Hi all! Thanx for all your comments and discussion!

    ChemSpiderMan, why another? JChemPaint goes back to 1998 already, so it can hardly be yet another :) Is is just a rewrite. So, let me answer the about equivalent question "Why a rewrite, if so many free tools are already available?"

    JChemPaint is still attractive for a number of reasons. One is that it is written in Java and can therefore be used in Java software. Another is that JChemPaint's OpenSource freedom goes as far as, just like the Bioclipse and CDK licenses allow, to be used in proprietary/commercial projects.

    JChemPaint, from the start, which semantic from the ground up: every pixel drawn was reflected in a chemical model; a reaction actually has explicit reactant and product sides, instead of implying the things left of the arrow are likely reactants ; labels are linked to objects, and not just floating around; etc. (not sure if these things still apply, but that was the state in 2003).

    Also, we just like the flexibility: the new design allows an applet, embedding in the SWT Bioclipse and Swing environments. The current design will mean a consistent behaviour across platforms (we are not quite there yet, though, but the design allows this).

    This flexibility in the new design also allows extending the default functionality, which we, for example, now use in Bioclipse to highlight SMARTS hits, toxicity alerts, etc. The design allows plugging in whatever functionality people like to add.

    The applet version is, as Rich pointed out too, an important platform for 2D editors. Support for CML is very important to us too, allowing us to semantically exchange chemical structures. And copy/paste of CML is for me of larger importance than MDL molfiles. The recent discussion on PubChem-CDK showed that MDL molfiles, for example, does not have in build support for dative bonds, which required PubChem to come up with modifications to the de facto standard.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. @All: Just to let you know I made the proposed "copy as" add-in for Symyx Draw 3.2. It offers the ability to copy molfile, SMILES and ChimeString (encoded molfile) to windows clipboard as text.

    I also made an add-in which allows you to import / export CML from Symyx Draw.


    I'll try to get these posted on the Add-ins page at symyx.com some time soon.

    Mean time if you have Draw 3.2 and you'd like to test them then get in touch here and I'll see what I can do...

    The Symyx Draw Structure Resolver is available to download now, but you need to have Draw 3.2.

    Also there is a new version of the OSRA addin which simplifies installation and configuration. Keep an eye on Igors site: the new add-in version is 1.3.2.0. (requires Draw 3.1 or later)

    About Symyx Draw...

    To answer on another point raised, it's worth mentioning Symyx Draw (3.1 onwards) has a jni component which means that though it's a .Net application it can also be used in Java applications: both thick and web. For instance tyhe latest DiscoveryGate can use either Java Draw or .Net Draw.

    Also, the current plan is that Symyx Draw 4.0 will add support for incompletely defined structures. 4.0 should be out later this year and - did I mention it's FREE to non-commercial users?

    When I have some time later this week I'll try to post some code here to show you how easy it is to take a bunch of non reaction sketch files and extract the chemistry into Molfiles. (it's possible to do the same with rxnfiles, even at the same time, but I'll keep the example simple.)

    ReplyDelete
  13. Hi James,

    if I understood correctly Symyx Draw is free for academics. However, I could not find a download location on the webpage... Can you please send me a copy for Ubuntu 9.04?

    ReplyDelete
  14. Here's the link for no fee Symyx Draw:

    http://www.symyx.com/products/software/cheminformatics/symyx-draw-no-fee/index.jsp

    ReplyDelete
  15. PS - its Wondows only - no linux versions (yet...)

    ReplyDelete
  16. but, the new Symyx JDraw applet should work fine on Linux :)

    ReplyDelete
  17. ChemDraw and Symyx Draw are pretty good for desktop; Marvin's drawing experience is not compatible, kind of strange. For web, applet and activex always get this or that problem, especially in large pharma company. There is a javascript editor/viewer, which might be the best for web.

    ReplyDelete
  18. And then we need to separate the marketing from the material.

    Just for fun, see this comparison from Symyx for chemical editors (http://www.symyx.com/micro/jdraw/JDraw-comparison.pdf), obviously they are misrepresenting Marvin badly here, but the question is - do they know?

    ReplyDelete
  19. @TonyY
    Did you check MarvinSketch "View">"Configurations". We have ChemDraw and ISISDraw 'like' skins there, keyboard shortcuts are also supported. You can make your own skins even. Did you know about this?

    ReplyDelete