Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Wednesday, August 11, 2010

ChemSketch on Linux Again

Last year I wrote about using ChemSketch on Linux.  It is about the only Windows program that I regularly use these days.  Since switching to Linux I have not  completely settled on a chemical structure drawing program.  Sometimes I still use ChemSketch on Windows and then copy the image into OpenOffice, sometimes use another program on Linux - usually MarvinSketch.

Thanks to a comment left by Dragly on my original ChemSketch post in January, I can now reliably use ChemSketch on Linux.

ChemSketch is a Windows program, so I have to use Wine in order to run ChemSketch.  The problem was that ChemSketch would run fine the first time it is started after installation, but every other time I tried to run the program it would hang-up without the ChemSketch window ever appearing.

Dragly's comment referred me to:
http://markmail.org/message/grddjlgsn3dh5kqp
And he also pointed out that the program could be run with the window maximized by using this command, provided that the file path to the program is correct:
wine start /MAX C:\\WINDOWS\\TEMP\\ACDFREE12\\CHEMSK.EXE
This works, but it behaves a bit flakey for me running Ubuntu 10.04 and Wine 1.1.42.  First the ACD/Lab Products panel appears (very slowly) - after clicking the "OK" button, the program itself loads on the workspace to the right of the one I am working on. The 3D View program behaves the same way - you need to use:
wine start /MAX C:\\WINDOWS\\TEMP\\ACDFREE12\\SHOW3D.EXE 
to get it to open normally, and then it shifts one workspace to the right.

After digging around a bit, it turns out that the problem is in the Wine registry file, which for me is at
/home/steve/.wine/user.reg
This file is updated every time you close a program that is running under Wine.  The quick and dirty solution would be to delete this file before running ChemSketch.  Except for losing all the settings for every program you run with Wine, this works pretty well.  The program starts normally - if a bit slowly compared to Windows.

The clever thing to do would be to edit user.reg to delete the offending setting, which starts with
[Software\\Advanced Chemistry Development (ACD)\\Size]
and is followed by a bunch of numbers.  Deleting this setting allows you to run ChemSketch and the 3DViewer "normally."    This is a bit tedious but do-able.  To be really clever I should write a program to do it for me every time I run ChemSketch.

Under Windows, you can open the 3DViewer from ChemSketch by using the ACD/Labs menu. Unfortunately, when I run under Linux, this menu does not have any of the labels visible.  The first menu item is the 3DViewer.  Or you can right-click the ACD/Labs icon in the Gnome panel at the top of the screen and select the 3D Viewer to open it.

Copying between the ChemSketch and 3D Viewer windows works, and so do the Database search options.  The only remaining problem is getting the figure into an Open Office document.  You can't simply copy the image, nor can you insert an OLE object the way you would in Windows.  Instead you will need to save the figure as an image and import the image into the Open Office document.  The downsides of this are adding an extra step to save the image, and not being able to edit the image easily unless you also saved the original ChemSketch file.

Enhanced by Zemanta

Sunday, August 30, 2009

ChemSketch on Linux? Maybe not ...

Ever since I started using Ubuntu last Spring I have been looking for a Chemical Structure Drawing program that runs on Linux. On Windows, I have been using ACDLabs ChemSketch ever since version 1.0 in the 1990's. They are up to version 12, and every new release has lots of good stuff. It's available as a free download for educational use, I recommend it to my students for writing their lab reports.

When I realized that they had put out a Linux-compatible version I was really excited. ChemSketch is about the only program I use that I need Windows to run. Unfortunately it doesn't look like that's going to work out.

After you register to download the Linux installation program, you get an exe file. Unless you read carefully you may have missed the reference to CodeWeavers Crossover. EXE files don't run on Linux systems, but you can run them with a Windows Emulator which is what Crossover does. Crossover is not a free program, but it is based on a program called Wine, which is free.

I have tried both Wine and Crossover (as a free trial version) and ChemSketch seems to work pretty well with both. There is a problem though: After installing ChemSketch I can run the program just once. When you start ChemSketch you see a splash screen displayed, then a CheckBox describing ACDLabs products appears. Once you click the OK button, the CheckBox goes away and the ChemSketch window opens. In addition to the ChemSketch window, the ACDHost runs as an icon in the top panel.

The second time (and every other time) I try to run ChemSketch on Ubuntu, that icon is the only sign that ChemSketch has started. I see the splash page and CheckBox as usual, then nothing happens. I get the same result whether I use Crossover or Wine to install and run ChemSketch. The only thing I can do is right click the ACDHost icon and choose "Close All" to exit the program.

It's puzzling and quite frustrating. Obviously the program will run (once) and everything seems to work the way it does under Windows. The System Monitor shows processes for ACDHost and ChemSketch with their status listed as Sleeping. What do I have to do to wake them up? There may be a simple answer to this, but I'm still really new to Linux and I haven't figured it out yet.

Monday, August 10, 2009

Drawing Molecules with SMILES

Lately I have discovered that when drawing 2D or 3D chemical structures, it is often a lot easier to input a SMILES string than to draw it with the GUI. It reminds me of when I first started using Windows (v. 3) - at times I thought it was easier to type a command to tell the computer what I wanted to do instead of hunting through menus and dialogs to find the thing I needed to click.

SMILES is a way of describing a chemical structure on a single line - a LOT like a conventional condensed formula except without the Hydrogens. It is commonly used in database and chemical informatics applications. In an earlier post on Surfactants, I wanted to include the structures of a couple of perfluorinated surfactants. Drawing all 15 fluorines individually was just too tedious, it was much simpler - believe it or not - to type: FC(F)(F)C(F)(F)C(F)(F)C(F)(F)C(F)(F)C(F)(F)C(F)(F)C(F)(F)C(=O)O

Drawing large and complex compounds "by hand" is also a hassle - and in some cases very difficult to get a good looking structure. Fortunately, many on line resources (e.g. Wikipedia, PubChem, ChemSpider) list the SMILES string for compounds like morphine:
Earlier in the summer I decided to install Ubuntu on my laptop in addition to Windows so I could run either operating system. One difficulty I have had in moving to Ubuntu is finding chemistry software to replace the programs I usually use on Windows. It turns out that several of the structure programs that I have been using lately will allow me to input a SMILES string.

One program I have been experimenting with lately is Avogadro - an open source project for building and studying 3D chemical structures. Avogadro is available on both Windows and Linux (as well as Mac), which is pretty convenient for me right now. It is a very nice program, they are at version 0.9.7 and plan to release 1.0 in September.

For drawing 2D structures on Windows I use ChemSketch, available as freeware from ACDlabs. On Ubuntu I have tried several 2D structure programs, none that match up to ChemSketch. One that I have used most is BKChem, which I used for the structure of Morphine above.

Saturday, August 1, 2009

Chemistry Graphics Hassle on Ubuntu

Lately I have been using Ubuntu Linux instead of Windows, and on the whole I think I prefer Ubuntu:
  • Ubuntu starts-up and shuts-down faster than Windows
  • Open Office is faster with Ubuntu (I never use MS Word even on Windows)
  • security is much less of a problem (although I do use a virus scan package with Ubuntu)
  • FREE SOFTWARE
  • and the geek factor of using Linux probably appeals to me as well
One difficulty for me has been finding chemistry-specific software to take the place of the Windows programs I am used to using. That situation improved a little bit today.

Avogadro and Ghemical are two programs I have been playing around with for building and doing simple calculations on 3D molecular structures. They both have a window that displays the molecule in 3D, and up until today that has been a problem for me. Frequently the desktop would "bleed through" so I couldn't see the molecule being displayed. Depending on what I was doing it was either inconvenient or a major annoyance. It would be so much easier to do things in Windows. That would involve re-booting the computer and starting Windows - something I try to avoid doing these days.

It turns out the solution was pretty simple, but I'm still a newbie with Linux and it took me a while. If I turn off the fancy graphics for the desktop, the problem goes away. The first time this idea occurred to me I went into the Compiz control panel and didn't know where to even start - and I wanted to be able to turn everything back on again if that didn't work. Compiz has LOTS of settings, I tried a few things without making matters any better.

Instead, what I should have done was go to the System Preferences and select "None" on the Visual Effects tab. Problem solved! The Visual Effects aren't all that important to me, but it's nice that I can turn them on and off so easily.

Now I can spend some time playing around with Avogadro and Ghemical to figure out what they do.

Thursday, April 23, 2009

Exploring Ubuntu

I've had a mild curiosity about the Linux operating system as an alternative to Windows for a long time.  Actually installing it always seemed like more trouble than I cared to bother with, but recently I have seen a few things that convinced me to look into it.

This post from Lifehacker about Portable Ubuntu convinced me that I could take a look at the Ubuntu version of Linux without doing anything more complicated than installing another program under Windows.  Portable Ubuntu installs everything it needs into a single folder on Windows, so it doesn't affect the regular Windows operating system at all.  You run Portable Ubuntu just like any other Windows program.  It appears as a toolbar with menus for Programs, Places (the file system) and System settings.  Although in most cases it doesn't run the same programs you would use in Windows, it does have programs that do all the same things I would normally do in Windows.  The only immediate problem I have is drawing 2D chemical structures, which I'll save for another post.

Portable Ubuntu convinced me that there's nothing scary, or even all that unfamiliar, in using Ubuntu instead of Windows.  But I have found that my Windows machine is increasingly a memory hog and running Portable Ubuntu at the same time only makes this worse.  I decided to take the next step and install Ubuntu outright.

The Ubuntu version of Linux is designed to be REALLY easy to use, especially for newbies.  You have lots of options for installing Ubuntu:
  • turn on your computer with a Live CD in the diskdrive and you can run Ubuntu from the CD without installing anything on your hard drive.  Of course you can't save anything this way, and it is slow because the operating system has to read everything from the CD first.
  • use the Live CD to install over Windows - if you don't want Windows anymore you can go to a Linux-only machine. 
  • If you still want to have the option of running Windows you can partition the hard drive, leaving Windows intact one one partition and installing Linux into the other partition.
  • If you don't want to partition you can use Wubi, which is what I decided to do.  Wubi installs Ubuntu into a folder - no partitioning required - and Windows is not affected.  When you turn on your computer, you will get a screen asking which operating system you want to run: Windows or Ubuntu.  One nice thing about Wubi, if you have internet access you don't even need the CD.  Wubi will download everything for you - of course downloading 700+ MB will take some time.
If you are a fan of Manga, check out this Manga Comic to see exactly how easy it is to install Ubuntu.  Why do the people in Manga look like they have fangs?  Link via BoingBoing.

Personally, I like to have the instructions to read.  Or at least a nice tutorial.  If you do too, take a look at the free Linux Starter Kit, from Linux Format magazine. Link via Greg Ladens blog.