[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bkchem-user] Using BKChem as a library for generation of 2D structu
From: |
Beda Kosata |
Subject: |
Re: [Bkchem-user] Using BKChem as a library for generation of 2D structure images |
Date: |
Thu, 27 Mar 2008 16:01:59 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20070728) |
Hi Noel,
I am just testing Pybel with the intention to use it in BKChem :) Thanks
for the work you are putting into it.
As for your question, yes it is possible. For this you could use either
a bkchem batch script (http://bkchem.zirael.org/batch_mode_en.html) or
(in case you could do with uglier picture, but need it fast) you could
use only the underlying oasa library which has support for exporting
PNGs on its own.
The first thing could be done with a script sm2png_batch.py (just a
quick hack, I could elaborate more if needed). You can run the script
like this:
bkchem -b sm2png_batch.py c1ccccc1
I am now not able to provide a quick example for the second approach
because I am in a hurry, but I could send it tomorrow if you are interested.
Best regards
Beda
Noel O'Boyle wrote:
> Hello Beda,
>
> I'm working on Pybel (OpenBabel Python wrapper) and am looking into
> ways of generating a quick view of the structure of a molecule. Is it
> possible to use BKChem to generate an image of a molecule from the
> Python prompt which I can then display?
>
> I don't want to start BKChem itself, although that is another
> possibility (but that is a different problem). I just want to display
> a simple 2D view of a molecule.
>
> If this is possible, I would appreciate some pointers on how to do this.
>
> Regards,
> Noel (O'Boyle)
>
>
> _______________________________________________
> Bkchem-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/bkchem-user
>
--
Bedrich Kosata
Laboratory of Informatics and Chemistry
ICT Prague
Czech Republic
import os
smiles = Args[0]
App.add_new_paper( "out.svg")
mol = App.read_smiles( smiles=smiles)
plugin = "PNG (Cairo)" # the name of the export plugin
outname = "out.png"
App.plugin_export( plugin, filename=outname)
App.close_current_paper()
smime.p7s
Description: S/MIME Cryptographic Signature
Re: [Bkchem-user] Using BKChem as a library for generation of 2D structure images, mpalmer, 2008/03/27