[Jalview-discuss] Using JalView source code
jprocter at compbio.dundee.ac.uk
Fri Jun 24 08:44:35 BST 2011
On 22/06/2011 23:43, Andy Lai wrote:
> I would like to write an interface that shows some tabularized data
> for a set of genes. The nature of this table is such that it pops up a
> window that shows a MSA using JalView (along with its cool features)
> upon selection of a gene. What I need is to somehow pipe info from my
> interface directly to JalView without having to open a separate
> JalView process each time. Is there some easy way I can do this or do
> I have to actually call the JalView source code?
How you do this depends very much on the environment where your
interface is running. It sounds like you are developing a standalone
application, so you really only have three choices. Launching separate
Jalview Desktop processes is easy, but as you say - inelegant. The
alternative is to launch one Jalview process - either within the same
JVM as your application (assuming you're working in Java), or as a
separate process, and communicate with that.
For the single process case (where Jalview lives in the same JVM), the
currently released versions of the desktop application do not have a
well defined java api or script-based control language that would allow
you to do this easily, but its something we'd like to develop - so I'd
be happy to give you a hand in identifying the best way of
opening/closing jalview displays programmatically within the same JVM.
Alternately, you can launch a second Jalview process and communicate
with that. Whilst the lack of a script-based control language makes this
difficult (ie you cant simply open a pipe to the Jalview process and
send commands and data down it), there is a mechanism that allows a
program to dynamically share data with an existing Jalview process, but
it's still very much a prototype. If you're working in Java, then you
should take a look at the VAMSAS library at www.vamsas.ac.uk - this
provides an api that allows a program to create a shared document for
bioinformatics data and annotation and exchange selection and mouseover
events with other applications that are connected to the same document
(allowing you to raise a particular alignment window, for instance). I
suspect that you might need a bit more control than this - but if not,
then VAMSAS might be the quickest route to achieve what you want to do.
> Also, I appear to be having trouble compiling the JalView source code.
> It appears there are some non-standard characters being used in some
> of the classes. I've tried a few common encoding schemes like UTF-8,
> UTF-16, and ASCII, but these characters are still unreadable (I am
> using NetBeans IDE but I doubt that makes much of a difference). Based
> on what I gathered from the code-level descriptions, these are
> delimiter characters. Do you happen to know what encoding scheme I
> should be using?
Typically, UTF-8 is the standard encoding format for source code in
Java. However, the character encoding warnings are annoying but not
serious - since most java compilers gracefully deal with the problem ..
does netbeans fail to compile those classes ? If so, there may be a
setting that will disable this check. Alternately, you might consider
using the latest development version's source from the jalview git
repository (http://source.jalview.org/git/jalview.git) - where I've
fixed up some of these encoding problems. If you use this, however, then
bear in mind that Jalview is under active development, and make sure you
frequently pull updates from the server.
> Finally, it appears the JMol jar file is missing the
> org.jmol.applet.AppleConsole class. I nabbed that class from the JMol
> website, so it's okay, but I am wondering if I am the only one having
> that problem.
This problem is because Jalview's source supports two compilation
processes (Jalview Desktop and JalviewLite) that have slighly different
external library dependencies. The desktop uses libraries in the lib
directory at compile and runtime, whereas the applet uses the libraries
in the appletlib directory. Just add all jars in both directories into
the build path of your netbeans project. You should also bear in mind
that there is a another gotcha that you need to deal with - Jalview has
an ant build script which handles various precompilation steps (copying
help files and non-compilable resources like images to the build
directory). At the very least, make sure that netbeans executes the
'buildindices' ant target prior to launching Jalview. (for a complete
description of this for eclipse, see Lauren Lui's blog here
If your interested in getting Jalview to play nice with your interface -
via any of the approaches above or some other approach, then I suggest
you request subscription to jalview's development mailing list (at
http://www.jalview.org/mailman/listinfo/jalview-dev), and we can
continue the discussion there.
Cheers for the email!
More information about the Jalview-discuss