[Biojava-l] Blast2HTMLHandler.java bug

Colin Hardman colin.hardman@cambridgeAntibody.com
Fri, 15 Feb 2002 10:39:29 +0000


Hi Simon,

Your fix is correct with the addition that you also need to remove the line
272
in the Summary endElement code else the last item will be duplicated.

} else if ( poElementName.equals( "Summary" ) ) {
   oRenderer.writeCurrentSummary( oHitSummary ) ;
   oRenderer.endSummaryTable();
}

becomes

} else if ( poElementName.equals( "Summary" ) ) {
   oRenderer.endSummaryTable();
}

I've made the changes in biojava-live.

Thanks,

Colin


Simon Foote wrote:

> Hi Simon,
>
> I've found a bug in the Blast2HTMLHandler code.  In the hit summary
> section that it produces, the score and expect values are shifted by 1
> result.  Thus, the first hit has the score & expect from the 2nd and so on.
>
> I fixed it as follows (not sure if this is correct way, but it seems to
> work):
>
> - removed the else part of the if statement at lines 173-178: (in
> startElement method)
>     } else {
>               oRenderer.writeCurrentSummary( oHitSummary );
>     }
> - added to endElement method above line 273:
>     } else if ( poElementName.equals( "HitSummary" ) ) {
>         oRenderer.writeCurrentSummary( oHitSummary );
>
> Regards,
> Simon Foote
>