[Jalview-discuss] Re: linkUrl and regexp
Sebastien MORETTI
sebastien.moretti at unil.ch
Tue Sep 9 13:38:42 BST 2008
James Procter a écrit :
> Hello Sebastien.
>
> congratulations - you have uncovered more bugs in Jalview! As a result,
> this is a lengthy reply... (but not as long as the three emails you have
> already sent today - thanks for your patience)
>
> Sebastien MORETTI wrote:
>
>> "Sequence not found" message came from a forgotten tab. It is resolved
>> now, sorry.
> ah. OK. That error is usually raised when the parser cannot find enough
> tab-separated fields from the feature file line (it's not a very
> informative error message, I'm afraid..).
>
>> But I do not have links yet.
> ahem - yes. about that.
>
> Providing your feature file parses (ie it has tab characters separating
> each field), then the problems are as follows:
>
> 1. As you have noticed, the html parser in jalview is _very_ basic. It
> expects XML attributes to be quoted with double quotes ('"') not a
> single quote (''') (also, please bear in mind that single quoted
> attributes is non-standard XML and will not validate).
>
> This means you should have a feature file with lines like:
>
> <html><a
> href="http://www.ensembl.org/Homo_sapiens/searchview?species=;idx=;q=ENSG00000166598">ensembl</a></html>
> ENPL_HUMAN -1 0 0 DBRef
>
> Note I have used '0' in the start/end fields. This is because I was in
> error in my previous reply:
>
> 2. Non-positional features are specified by putting a '0' in both the
> start and end (not a '-1' as I said previously - sorry).
>
> Finally... the real problem:
>
> 3. Link display for non-positional features appears to be broken...
> So even if you got the features to be listed in the sequence ID tooltip,
> no links would be generated from the URL links embedded in the sequence
> features.
>
>
> This successfully scuppers my original suggestion of using
> non-positional sequence features to append URLs......... however... I
> have checked in a bug fix for #3. Both the applet and application now
> generate URL links from links embedded in non-positional features.
> Furthermore, the applet now displays non-positional features within the
> tooltip.
>
> can you try it out ?
> (http://www.compbio.dundee.ac.uk/~ws-dev1/jalview/latest)
> Jim.
>
> ps. As an alternative, I have also re-instated the 'generate URL from
> sequence description' code too, but made it so that only URLs which
> contain regexes are used to process the description. This is still not
> ideal, but more appropriate than simply making a URL substitution using
> the whole description string.
Many thanks !
Both strategies work, non-positional features within the tooltip & with
linkURL.
I have kept linkLabel_1/linkUrl_1 only because I think it is easier for
users and I have no feature file to create.
<param name="linkLabel_1" value="Ensembl" />
<param name="linkUrl_2"
value="http://www.ensembl.org/Homo_sapiens/searchview?species=;idx=;q=\$SEQUENCE_ID=/GENEID=(\\w+)
TAXID/=\$" />
Maybe you have to specify in the documentation that regexp in
$SEQUENCE_ID have to be back-slash protected following computer
languages used to make applet parameters.
Thanks again.
p.s.: We will send you something for Christmas ;-)
--
Sébastien Moretti
Department of Ecology and Evolution,
Biophore, University of Lausanne,
CH-1015 Lausanne, Switzerland
Tel.: +41 (21) 692 4221/4056
http://bioinfo.unil.ch/
More information about the Jalview-discuss
mailing list