Miscellaneous Problems

Out of Memory

Running out of memory is tough to detect and deal with in java, since most of memory allocation is hidden from the java developer. If you are working with large data sets, or on a computer with a small amount of RAM, it is easy to run out of memory because java is not very memory efficient, and more importantly most Java Virtual Machines (JVMs) are too stupid to grow to take up more memory than some default arbitrary maximum.

There are only two possible solutions to the out of memory problem in java. Either I write a platform-specific launcher for each platform that informs the JVM of the extra ram, or you run the application from the command line and tell the JVM about the RAM yourself. Currently, only the latter is supported.

To run the application from the command line, first get to a terminal. This should be obvious to someone on a unix machine. On Mac OS X, run the Terminal program which is in the utilities folder. On Windows, select Start->run... and then type cmd <return> . Curously, on Mac OS 9, this problem does not seem to arise. I suspect this is because the OS 9 JVM is smart enough to use the per-file memory settings.

Next, switch to the directory containing the java treeview distribution (using either cd or chdir or whatever), and then type

java -Xmx###m -jar TreeViewLauncher.jar

Where the number following Xmx is the maximum amount of memory in megabytes that the JVM is to use. You may as well specify the available system RAM; the JVM won't take it unless it needs it. Also, make sure that you're in the directory with the jar files so that the command will work. Check out Figure 3.1, “Screenshot of Running Java TreeView from the Command Line with 800 Megs of RAM” for an example.

Figure 3.1. Screenshot of Running Java TreeView from the Command Line with 800 Megs of RAM

Screenshot of Running Java TreeView from the Command Line with 800 Megs of RAM

Displaying Annotations

Question: I have two columns before I get to my data, the first being ID(containing accesion number), and the second is "NAME" (containing Unigene ID). The data follows in each column after these two. When treeview loads it up, it only displays the 2nd column "NAME", instead of both columns data when highlighting aspects of the cluster. Is this right?

Answer: Yes. TreeView used to display all annotations, but it annoyed some people. To specify the ones you want, use Settings->Annotations...

Switching browsers

On the windows and mac platforms, the system default browser is used to open urls. In order to change it, you must muck around with your control panel.

On unix, there is no notion of a system default web browser, so I just hardcoded in a call to netscape. If you don't have netscape, or you want to use another browser, just alias netscape to that other browser from the shell in which you're launching java treeview. Something like the following should work:

alias netscape mosaic

java -jar TreeViewLauncher.jar

If the above doesn't work, then the JVM is spawning a sub-shell to run the call to netscape in. In that case, you need to add the alias to your .profile or equivalent, or perhaps just add a link to your preferred browser such as the following:

ln -s /usr/bin/mosaic netscape

Strange drawing of dendrogram branch lines

Some people have been thrown off guard by dendrograms such as the one depicted above. The strange appearance of the tree, where the parent node of dpy-8 and col-67 has a lower correlation than its parent, is a correct representation of the clustering algorithm used to generate the tree. Indeed, the correlation between the two genes is .889, whereas the correlation of the next join up is .908. This simply means that the average of dpy-8 and col-67 is more similar to the next node up than they are to each other (and, by implication, than either dpy-8 or col-67 alone are to the next node up).

If such behavior disturbs you, please use a different correlation metric, such as complete linkage. Certain other visualization programs, such as the original Treeview, artificially force parent nodes to have a correlation equal to or less than that of their children, but I choose to accurately represent the information in the GTR and ATR files.

Crashing on Mac Os X

Typical symptoms are the application seems to lock up after a fairly innocuous user action, and then the application suddenly quits. If you ware running from the command line, you may see a report of a "bus error" or "segmentation fault". Running "Console", an application that comes with OSX and can be found in the Utilities subfolder of the Applications folder, should reveal something like

May 18 11:27:19 Alok-Saldanhas-Computer /Users/aloksaldanha/Desktop/code/java/LinkedView/bundle/TreeView/Java TreeView.app/Contents/MacOS/JavaApplicationStub: An error report file has been saved as /Users/aloksaldanha/Library/Logs/JavaNativeCrash_pid2964.log.  Please refer to the file for further information.

 
May 18 11:27:21 Alok-Saldanhas-Computer crashdump: Crash report written to: /Users/aloksaldanha/Library/Logs/CrashReporter/JavaApplicationStub.crash.log

May 18 11:28:03 Alok-Saldanhas-Computer WindowServer[188]: Reserved range exhausted. (0xbbf4b000 to 0xbc1d1000 goes out of bounds)

May 18 11:28:10 Alok-Saldanhas-Computer /usr/bin/java: An error report file has been saved as /Users/aloksaldanha/Library/Logs/JavaNativeCrash_pid2971.log.  Please refer to the file for further information.

as opposed to

[error] apple.awt.EventQueueExceptionHandler Caught Throwable : 
[error] java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 52133
[error] 	at org.gjt.sp.jedit.Buffer.getLineOfOffset(Unknown Source)
[error] 	at xml.TagHighlight.updateHighlight(Unknown Source)
[error] 	at xml.TagHighlight.access$000(Unknown Source)
[error] 	at xml.TagHighlight$1.actionPerformed(Unknown Source)
[error] 	at javax.swing.Timer.fireActionPerformed(Timer.java:271)

In general, if Java Treeview crashes it is advisable to check the console for messages. The former indicates a bug in the JVM, not in Java Treeview, which at some point I should write up as a formal bug report. Something like the latter indicates a bug in Java Treeview, although this particular instance was another java program. There are at least two causes for the JVM crashes, one of which is somewhat understood. If you are launching Java Treeview by double-clicking a jar file, and you have multiple views open, you could be triggering a bug in the Mac OSX Java libaries related to font rendering. Either run Java Treeview with the following command line:

java -Xmx500m -Dapple.awt.TextAntialiasing=false Treeview.jar

or just use the double-clickable application that comes in the .dmg download.

Java Treeview may also crash when you select entries from the most recent file listing. It is not clear what causes this or how to fix it at the moment.