public void parse() throws IOException
{
// TODO set the filename sensibly
- id = (inFile == null || inFile.getName().length()==0) ? "PDBFILE" : inFile.getName();
+ id = (inFile == null || inFile.getName() == null || inFile.getName()
+ .length() == 0) ? "PDBFILE" : inFile.getName();
try
{
chains = new Vector();
{
if (line.indexOf("HEADER") == 0)
{
- // make sure we don't get zero length ID strings
- String tid = line.substring(62, 67).trim();
- if (tid.length()>0)
+ String tid;
+ if (line.length() > 62)
{
- id = tid;
+ if (line.length() > 67)
+ {
+ tid = line.substring(62, 67).trim();
+ }
+ else
+ {
+ tid = line.substring(62).trim();
+ }
+ if (tid.length() > 0)
+ {
+ id = tid;
+ }
}
continue;
}
}
dataset.addPDBId(entry);
SequenceI chainseq = dataset.deriveSequence(); // PDBChain objects
- // maintain reference to
- // dataset
+ // maintain reference to
+ // dataset
seqs.addElement(chainseq);
AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
if (chainannot != null)