Per-group annotation-based color schemes

Hi all,

I'm trying to color an alignment on a per-group basis according to
numerical values coming from multiple annotation files.

For example, let's say I've got Groups A and B and numerical
annotation tracks X and Y. Would it be possible to color group A
according to X, and B according to Y?

I'm relatively new to the Jalview UI, but it appears that the Color ->
By Annotation panel only allows one to set the global color scheme.
And when I right-click on a group that I wish to color and select
Selection -> Group -> Group Color, I see a menu with various group
coloring options, but the "By Annotation" option is notably missing
from the list.

I'm up and running with the Jalview source code in Eclipse, so I'm
investigating how to approach this need either by (a) updating the UI
or (b) writing a script (Java or Groovy) to handle what I'm looking
for. Most likely, I'll pursue option B for the purposes of our current
project, with an eye towards option A for the sake of longevity. Has
anyone run into this issue before, or are there any tips on how to go
about implementing this?

Suggestions from more experienced users or developers would be much appreciated!

Cheers,
  Greg

Hello Greg.

Gregory Jordan wrote:

I'm trying to color an alignment on a per-group basis according to
numerical values coming from multiple annotation files.

For example, let's say I've got Groups A and B and numerical
annotation tracks X and Y. Would it be possible to color group A
according to X, and B according to Y?

Not in Jalview 2.4. As you've noticed, the current UI only allows per
annotation colouring/shading as a colourscheme that is overlaid on all
positions of the alignment (in the same way that 'show features'
overlays features onto the alignment). We did have a prototype where
each sequence was coloured with its own per-sequence annotation row, but
rendering wasn't efficient enough for production use.

I'm up and running with the Jalview source code in Eclipse, so I'm
investigating how to approach this need either by (a) updating the UI
or (b) writing a script (Java or Groovy) to handle what I'm looking
for. Most likely, I'll pursue option B for the purposes of our current
project, with an eye towards option A for the sake of longevity. Has
anyone run into this issue before, or are there any tips on how to go
about implementing this?

The simplest way of doing this in jalview 2.4 would be to create
sequence feature files that tile each sequence with features coloured
according to your own pre-calculated scheme. This is guaranteed to work
with minimal coding effort.

The next level of complexity would be to implement the feature file
generation routine as a groovy script launched from within jalview. You
could then launch jalview with your data and execute the script to
retrieve and parse your quantitative data directly and add the generated
features to the current alignment.

Of course, the best solution is to properly implement the per-sequence
annotation shading in Jalview, and it'd be great if you want to have a
go. Its not really that hard to implement (IIRC), and I'd be happy to
advise on how to go about it (off list). However, I can understand if
you'd rather take the former route and implement something quickly
without actually delving into the guts of Jalview.

Suggestions from more experienced users or developers would be much appreciated!

:wink:

so - the choice is yours - let me know if you want to go the whole hog
and I'll hunt out the bits of relevant code fragments in a day or two.

Jim

···

--
-------------------------------------------------------------------
J. B. Procter (ENFIN/VAMSAS) Barton Bioinformatics Research Group
Phone/Fax:+44(0)1382 388734/345764 http://www.compbio.dundee.ac.uk
The University of Dundee is a Scottish Registered Charity, No. SC015096.