X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBfile.java;h=b368b9190012147af6d6b7b02dc807cee4e8a737;hb=e3d37653250ad19df4c310f1fd6a50510467a764;hp=5fd3d10a476afc610935dff9ff56bf6ba3548f92;hpb=506d60f0e188723ddc91c26824b41ac7034df3fe;p=jalview.git diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index 5fd3d10..b368b91 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4) - * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) + * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -55,7 +55,7 @@ public class PDBfile extends jalview.io.AlignFile public void parse() throws IOException { // TODO set the filename sensibly - id = (inFile == null) ? "PDBFILE" : inFile.getName(); + id = (inFile == null || inFile.getName()==null || inFile.getName().length()==0) ? "PDBFILE" : inFile.getName(); try { chains = new Vector(); @@ -70,8 +70,20 @@ public class PDBfile extends jalview.io.AlignFile { if (line.indexOf("HEADER") == 0) { - id = line.substring(62, 67).trim(); - continue; + if (line.length()>62) + { + String tid; + if (line.length()>67) { + tid = line.substring(62, 67).trim(); + } else { + tid=line.substring(62).trim(); + } + if (tid.length()>0) + { + id = tid; + } + continue; + } } // Were we to do anything with SEQRES - we start it here if (line.indexOf("SEQRES") == 0)