Hi Damian,

I noticed that it said it was for emma - yep, it should work fine with the emma formatting.

Cheers,

Daz

On 16 Jan 2009, at 16:03, Damian Smedley wrote:

Syed Haider wrote:
Hi Darren,

thanks for the fix, we will add it to the branch 0.7 soon.


Hi Guys,

my brain is hurting too much on a friday to follow the changes but just to add to the background I added the original hack to convert our mouse strain names in the EMMA database to the correct superscripted display. We store them slightly differnet to you Darren i.e. in our db Art4<sup>tm1a(KOMP)Wtsi</sup> would be stored as Art4<tm1a(KOMP)Wtsi> (decided before my time!) so the hack was to remove the < and > and convert everything inside to superscript. Presume this will work with the new code?

Cheers
Damian

Cheers
Syed




Hi All,

I think I've found a bit of a bug in the HTML formatting code for text.

If someone has deliberately put some HTML in a field (in our case a
pair of <sup> tags), the formatting code strips only portions of the
offending tag(s) and leaves a bit left over.

In our case it stripped the first < and the closing </sup>, but left
sup> at the beginning of the text that was supposed to be superscripted.

i.e. Art4<sup>tm1a(KOMP)Wtsi</sup> became Art4sup>tm1a(KOMP)Wtsi with
some extra span tags to make the latter part superscript.

I've had a look at the code and come up with a small fix that seems
to work here so I thought i'd better let you guys know about it.

Here's the diffs:

Index: lib/BioMart/Formatter/HTML.pm
===================================================================
RCS file: /cvsroot/biomart/biomart-perl/lib/BioMart/Formatter/ HTML.pm,v
retrieving revision 1.9
diff -r1.9 HTML.pm
115,117c115,121
<        # superscripting for emma mart
<        $$row[$$attribute_positions[$i]] =~ s/\<(.*)\>/<span
style="vertical-align:super;font-size:0.8em">$1<\/span>/;
<
---
 >        # catch html formatting...
 >        if ( $$row[$$attribute_positions[$i]] =~ /\<.+\>.+\<\/.+
\>/ ) {
 >          # Do nothing - leave the original formatting
 >        } else {
 >          # superscripting for emma mart
 >          $$row[$$attribute_positions[$i]] =~ s/\<(.*)\>/<span
style="vertical-align:super;font-size:0.8em">$1<\/span>/;
 >        }

Index: lib/BioMart/Formatter/HTML_36.pm
===================================================================
RCS file: /cvsroot/biomart/biomart-perl/lib/BioMart/Formatter/
HTML_36.pm,v
retrieving revision 1.5
diff -r1.5 HTML_36.pm
256,259c256,263
<        # superscripting for emma mart
<        $$row[$$attribute_positions[$i]] =~ s/\<(.*)\>/<span
style="vertical-align:super;font-size:0.8em">$1<\/span>/;
<
<
---
 >        # catch html formatting...
 >        if ( $$row[$$attribute_positions[$i]] =~ /\<.+\>.+\<\/.+
\>/ ) {
 >          # Do nothing - leave the original formatting
 >        } else {
 >          # superscripting for emma mart
 >          $$row[$$attribute_positions[$i]] =~ s/\<(.*)\>/<span
style="vertical-align:super;font-size:0.8em">$1<\/span>/;
 >        }

Hope this is useful!

Cheers,

Darren

P.S. Cheers for making a great tool too!



--
 The Wellcome Trust Sanger Institute is operated by Genome Research
 Limited, a charity registered in England with number 1021457 and a
 company registered in England with number 2742969, whose registered
 office is 215 Euston Road, London, NW1 2BE.




======================================
Syed Haider.
EMBL-European Bioinformatics Institute
Wellcome Trust Genome Campus, Hinxton,
Cambridge CB10 1SD, UK.
======================================






--
The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

Reply via email to