Hi Joni.

I'm seconding Geoff's email - it's really good to hear you're 
progressing with adding services to JABAWS !  I've been working on 
adding JABAWS2 services to Jalview for the v2.8 release - and I think we 
might be able to help each other out here...

On 15/11/2011 19:48, Joni Fazo wrote:
> I'm working to create a new jabaws web service for the tool gblocks 
> (http://molevol.cmima.csic.es/castresana/Gblocks.html).  I am using 
> the MsaWS interface.  I have the web service working - sort of :)
>
> My problem is that gblocks expects aligned sequence as input.  My 
> gblocks web service works fine when given input sequence that is all 
> the same length, with no gaps.  But otherwise it fails, reporting that 
> the sequences are of different lengths.  All gaps seem to be stripped 
> off the sequence prior to the web service being called.
>
> I see that the Jalview class MsaWSClient has an attribute "submitGaps" 
> with a default value of false.  Is there anyway to set this to true 
> when calling a specific web service?
>
> This class also has a method canSubmitGaps with a TODO that makes me 
> think this capability is not yet available.  (see below).  Any tips on 
> a work-around?
>
>   private boolean canSubmitGaps()
>   {
>     // TODO: query service or extract service handle props to check if 
> we can
>     // realign
>     return (WebServiceName.indexOf("lustal") > -1); // cheat!
>   }
>
There's no straightforward workaround for version 2.7 of Jalview, I'm 
afraid. If you take a close look at the execution steps leading to a job 
being submitted by Jalview, you'll see that the 'canSubmitGaps' method 
is not actually used to decide if gaps are removed, but instead used to 
decide if a 'Realign with ..' menu entry is generated in addition to the 
standard 'align with ..' menu entries for alignment web services. 
However, hopefully, you've developed your service with the JABAWS 2 
development code that Peter Troshin sent you, in which case there's a 
definite way forward...

The real problem here is that GBlocks isn't a multiple alignment 
service, and trying to use code that expects to be talking to one kind 
of program but instead does something else is simply not going to work. 
The GBlocks service is a specific variant of an alignment analysis 
service where you submit an alignment and get back annotation of some 
kind; which, in this case, is annotation indicating which columns should 
be hidden in the view. Implementing a service for GBlocks following this 
pattern will ensure that it is robust and ultimately more usable, since 
it does what it says on the tin.

Fortuitously, JABAWS 2 already includes a canonical alignment annotation 
service model that would suit GBlocks, and I have already coded a client 
in the Jalview development branch[1] that could be easily adapted to 
mark the regions on the alignment annotated by the service as hidden 
regions.

All that would be needed is for you to refactor your new service code to 
implement the compbio.data.msa.SequenceAnnotation interface, and then 
add some semantic sugar in order to inform Jalview that the annotation 
should be used to mark the given regions as hidden. The semantic sugar 
comes in two forms:
1. Label the service with an appropriate service category in the JABAWS2 
discovery service. GBlocks performs a specific form of conservation 
analysis to identify conserved regions in the alignment, so it could be 
put in the 'Conservation' category - but this contains methods that 
produce alignment quality and conservation histograms. Instead, I'd 
suggest creating another category, such as 'Conserved Region Detection'. 
This will mean it gets placed in its own submenu on the web services menu.

2. Label the results in a way that makes it clear what Jalview should do 
with them. The result from an annotation service is a series of named 
sets associated with each sequence or the alignment as a whole, and each 
set consists of either a series of scores for each column of the 
reference (sequence or alignment) and a series of intervals which may 
optionally have scores associated with them. In the case of a single 
Gblocks run, you'd return the conserved regions as intervals in a single 
score set associated with the whole alignment. I'd recommend calling 
that score set something obvious like 'CONSERVED_REGION' .. that way 
it's quite clear what the interval refers to, and isn't specific to 
GBlocks - in case other conserved region detection programs get added to 
JABAWS.

The point of the sugar is to allow Jalview to do something sensible with 
the results. Typically, phylogenetically informative columns get marked 
with a '*' - so Jalview could add an annotation row where a '*' is 
present within each column of the conserved region. It could also 
automatically hide the columns outside the regions in the alignment view 
that GBlocks identified.

I'm happy to code the client that would do this, if you'd be happy to 
refactor the Gblocks service !
Jim.

[1] The jalview development branch build is at 
http://www.compbio.dundee.ac.uk/users/ws-dev1/jalview/develop/, and you 
can see the branch history at 
http://source.jalview.org/gitweb/?p=jalview.git;a=shortlog;h=refs/heads/develop

_______________________________________________
Jalview-dev mailing list
[email protected]
http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-dev

Reply via email to