Showing posts with label guides. Show all posts
Showing posts with label guides. Show all posts

Wednesday, May 11, 2011

The importance of being indexed

Playing around with iAnnotate for iPad and talking about it with Jan, I realized the importance of being able to swiftly navigate through documents. While reading an article or reviewing a manuscript it is important to be able to check quickly the content of figure 3 and then jump back to where one was in the text. iAnnotate has the possibility of including personalized bookmarks to a PDF document, but it is extremely boring, tedious, and time consuming to go through an entire document first to mark all the important features. PDF documents can have an embedded outline, as well as cross references to figures and tables. I found out that latex can do that for you almost effortlessly! One just need to include the hyperref package in the preamble. For example here is what I used while preparing my latest manuscript:

\usepackage[hypertexnames=false, naturalnames=false, dvips, colorlinks=true, linkcolor=black, citecolor=black, hidelinks]{hyperref}

Automagically all your \section, \subsection, \begin{figure} etc. commands will also produce a cross referenced link. In the mentioned example I hid in the text any sign of the links, but it is also possible to specify to have differently colored links or with colored boxes around.
In order to be able to use the "hidelinks" option one has to use the very latest version of hyperref. Think about it when preparing your next manuscript!

Tuesday, March 15, 2011

HowTo create the right environment to use PyRosetta on a Linux box

Since one year I have been involved in a project for which I decided to use a program called PyRosetta. From the website: "PyRosetta is an interactive Python-based interface to the powerful Rosetta molecular modeling suite. It enables users to design their own custom molecular modeling algorithms using Rosetta sampling methods and energy functions." The program comes as pre-compiled binaries for various platforms. The Mac version works fine in an out-of-the-box fashion, most likely because my Mac laptop and the small Mac-Mini where I installed PyRosetta are quite up-to-date. Unfortunately these resources are not sufficient to let me use extensively the program, but I had to struggle a lot to be able to use it on the Linux based clusters we have available here at the Department. Here is how I managed.

The Linux 64bit version of PyRosetta didn't run out-of-the-box, just like that. PyRosetta has a user forum that is only now slowly starting to work, so it wasn't easy to access more detailed information. If you don't have root access to your system, or simply you don't want to mess around with the rest of your installation you will need a local installation of gcc, and Python.

Let's suppose you are installing everything in /home/pyuser/programs . You need first to locally install mpc, mpfr and gmp, following the respective instructions. Download then gcc 4.5.2 or newer and tailor configure it from an object directory with:
../gcc-4.5.2/configure --prefix=/home/pyuser/programs --enable-bootstrap --enable-shared --enable-thread=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,fortran --disable-libgcj --with-tune=generic --witharch_32=i586 --build=x86_64-redhat-linux6E --with-gmp=/home/pyuser/programs --with-mpfr=/home/pyuser/programs --with-mpc=/home/pyuser/programs
Then run make and make install. Afterward you will need a local installation of Python 2.6, compiled with the just made gcc. Run the configure command as:
./configure --prefix=/home/pyuser/programs --enable-shared LDFLAGS='"Wl,-rpath /home/pyuser/programs/lib" --enable-unicode=ucs4
The directory /home/pyuser/programs/lib must be already present prior to the configure command, even if empty.

Then run make and make install. Once done, add /home/pyuser/programs, /home/pyuser/programs/bin to $PATH and /home/pyuser/programs/lib, /home/pyuser/programs/lib64 to $LD_LIBRARY_PATH before any other previously present path. You can check if your installation is correct by typing python. The output should look like something similar to this:
Python 2.6.5 (r265:79063, Jan 24 2011, 16:57:13)
[GCC 4.5.2] on linux2
If everything worked fine then you are good to go, just remember to source SetPyRosettaEnvironment.sh.

One final note: these instructions are relative to PyRosetta 1.0. Recently a 2.0 version has been announced as a Beta, based on the recently released version 3.2 of Rosetta. Unfortunately once again the only indications about which are the system requirements consist in "standard linux/Mac distributions".

Tuesday, February 15, 2011

Two Java-based Hückel Theory programs

I here share two examples of online Hückel approximation programs. The first is located here and denoted a) in the following, while the second example, b), may be found here. Please note, that b) may be slightly unstable towards refreshing the site but may still be adequate from a teaching point-of-view, though, as it is readily downloaded as a Java-file. Update: Program a) is available in a newer implementation here (thanks to Rafael R. Pappalardo for pointing this out in the Comments).


a):

The first program is indeed very intuitive in the sense that a molecule is easily sketched on the designated canvas and the calculation carried out by clicking just a single button on the right side of the screen. The individual carbons are marked on the canvas by initially clicking the 'Add' button to the left and subsequently placing the atoms by clicking the mouse at the appropriate locations. The bonds (only one type of bond exists, more on this below) are made by dragging a line between two adjacent atoms, equivalent to GView, Avogadro, Jmol, etc. When the molecule has been build and 'optimized' by clicking the 'Normalize' button in the left column, the calculation is made by clicking the 'Show Data Tbl' tab at the upper right corner. The results of the calculation now appears in a seperate window, divided into:
  • MO number
  • Orbital energies
  • Occupancies of the individual MOs
  • Population tables
  • Bond tables w/ appropriate Hückel bond orders
This program furthermore enables the option of illustrating the MOs. A MO diagram is build 'on-the-fly' as the user builds the bonds between the individual atoms, and by clicking the 'Show Molecule' tab in the lower right corner, the MOs are shown in accordance with the MO diagram. Note here, that the orbital energies are shown in the lower part of the screen when the user shifts between the individual MOs by clicking the 'Up' and 'Down' tabs next to the 'Show Molecule' tab.
As touched upon in the above, this program only offers sp2-hybridized orbitals in accordance with regular Hückel theory. The bonds may be altered, though, in an indirect manner, as the alpha- and beta-parameters are modifiable.




b):

As this program has shown to be rather unstable towards running directly from the browser, I would recommend downloading it by clicking the download link below the applet. The file is just a regular .jar file but advantages with respect to the browser applet in the fact that it is faster and more reliable. Furthermore, I will not comment on the Lewis part of the program, only the Hückel part.
In this program, the molecule is build following the same guidelines as for program a). Press 'Build' and draw on the canvas. As bonds are generated automatically in this program, the MO diagram to the right is dynamic as is the total energy, shown in the left column. By pressing the 'Results' button to the left, a seperate window appears, including:

  • The Hückel Hamiltonian (in contrast to program a)). Note that the form of the matrix is in accordance with the numbering within the molecule and may thus not resemble the expected.
  • The orbital energies in terms of the alpha- and beta-parameters.
  • The electron density matrix.
  • The atomic charges as well as the total charge.
As in program a), the degree of hybridization may be altered but in a fancier manner. By clicking the box 'Parameters' in the left side column, and subsequently clicking on one of the individual carbon atoms, the program lets the user change the atom type and hence the final Hamiltonian, etc.
UPDATE: As pointed out by Markus in the comments, you can also display MOs in HuLiS by clicking on specific MO's on the energy graph. Thanks to Markus for this comment.

Topics:

- Benzene: Use this link (see below) to illustrate the benzene MOs as a supplement to the MOs from program a).
Edit. As Jan mentions in the comments, this section of chemtube3d also serves as a great tool of visualization for the MOs of benzene.


- Naphthalene vs. Azulene. Calculate the differences in the HOMO-LUMO gap. Why does these differences exist and why is azulene dark blue, while naphthalene is colorless?

- Why is it impossible to design and describe 1-methylnaphthalene within the ordinary Hückel approximation? What is the 'Hückel equivalent' to 1-methylnaphthalene?

- Topic of discussion: If we really were to attempt a description of 1-methylnaphthalene, how could the program be manipulated (Hint: Think in terms of alternative ways of describing hybridization).