[Biojava-dev] PDBFileParser pdb_TITLE_Handler bug

Andreas Prlic andreas at sdsc.edu
Thu Jan 27 01:40:35 UTC 2011


Hi Steve,

Thanks, as usually, well spotted ...

Fixed in SVN...

Andreas


On Wed, Jan 26, 2011 at 1:44 PM, Steve Darnell <darnells at dnastar.com> wrote:
> Greetings,
>
> There is a small bug in PDBFileParser.pdb_TITLE_Handler().  It is working on the assumption that the title text occupies columns 10 to 70; the PDB format states it is from 10 to 80.  Consequently, long titles get truncated.
>
> >From 3NHE:
> 'TITLE     HIGH RESOLUTION STRUCTURE (1.26A) OF USP2A IN COMPLEX WITH UBIQUITIN  '
>
> Output from Structure.getPDBHeader().toPDB():
> 'TITLE     HIGH RESOLUTION STRUCTURE (1.26A) OF USP2A IN COMPLEX    '
> 'TITLE    2 WITH U                                                  '
>
> Output from Structure.getPDBHeader().getTitle():
> 'HIGH RESOLUTION STRUCTURE (1.26A) OF USP2A IN COMPLEX WITH U'
>
> Regards,
> Steve
>
> ________________________________________
> From: Susanne Schaller
> Sent: Tuesday, January 25, 2011 1:27 PM
> To: Steve Darnell
> Subject: Java source and pdb files
>
> If you say structures.getPDBHeader().getTitle() it cuts off the last letters.
>
> I've looked through the source code (look for PDBFileParser.java) of biojava3 and I think I've found the problem:
>
> There are only character from 11-70 allowed.
>
> Here is the source code from PDBFileParser.java:
>
> /** Handler for
>     TITLE Record Format
>
>      COLUMNS        DATA TYPE       FIELD          DEFINITION
>     ----------------------------------------------------------------------------------
>     1 -  6        Record name     "TITLE "
>     9 - 10        Continuation    continuation   Allows concatenation of multiple records.
>     11 - 70        String          title          Title of the experiment.
>
>
>      */
>    private void pdb_TITLE_Handler(String line) {
>         String title;
>         if ( line.length() > 69)
>             title = line.substring(10,70).trim();
>         else
>            title = line.substring(10,line.length()).trim();
>
>         String t= (String)header.get("title") ;
>         if ( (t != null) && (! t.equals("")))
>             t += " ";
>         t += title;
>         header.put("title",t);
>         pdbHeader.setTitle(t);
>     }
>
> _______________________________________________
> biojava-dev mailing list
> biojava-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-dev
>




More information about the biojava-dev mailing list