X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FBLCFile.java;h=4a9e77768e6f8da4767a96913e928b8fc7713dc6;hb=a7bec763a3e4f17a549115f8f9f19ee4c742c26b;hp=a7cc1eadf490f4b5b4ae6bec70c23b5de664d71b;hpb=55e2e9b22b133db8b9ff0979b0338a33081fc8fd;p=jalview.git diff --git a/src/jalview/io/BLCFile.java b/src/jalview/io/BLCFile.java index a7cc1ea..4a9e777 100755 --- a/src/jalview/io/BLCFile.java +++ b/src/jalview/io/BLCFile.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 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 @@ -42,15 +42,6 @@ public class BLCFile extends AlignFile { } - /** - * Creates a new BLCFile object. - * - * @param inStr DOCUMENT ME! - */ - public BLCFile(String inStr) - { - super(inStr); - } /** * Creates a new BLCFile object. @@ -77,7 +68,7 @@ public class BLCFile extends AlignFile /** * DOCUMENT ME! */ - public void parse() + public void parse() throws IOException { boolean idsFound = false; Vector ids = new Vector(); @@ -87,8 +78,6 @@ public class BLCFile extends AlignFile String line = null; - try - { do { line = nextLine(); @@ -146,17 +135,23 @@ public class BLCFile extends AlignFile for (int i = 0; i < ids.size(); i++) { - Sequence newSeq = new Sequence(ids.elementAt(i).toString(), - seqstrings[i].toString(), - Integer.parseInt(starts.elementAt(i).toString()), - Integer.parseInt(ends.elementAt(i).toString())); + Sequence newSeq = new Sequence(ids.elementAt(i).toString(), + seqstrings[i].toString(), + Integer.parseInt(starts.elementAt(i). + toString()), + Integer.parseInt(ends.elementAt(i).toString())); + + if (!isValidProteinSequence(newSeq.getSequence())) + { + throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS + +" : "+ newSeq.getName() + +" : "+invalidCharacter); + + } + seqs.addElement(newSeq); } - } - catch (Exception ex) - { - ex.printStackTrace(); - } + } /** @@ -193,9 +188,9 @@ public class BLCFile extends AlignFile { out.append(">" + printId(s[i]) +"\n"); - if (s[i].getSequence().length() > max) + if (s[i].getSequence().length > max) { - max = s[i].getSequence().length(); + max = s[i].getSequence().length; } i++; @@ -209,9 +204,9 @@ public class BLCFile extends AlignFile while ((i < s.length) && (s[i] != null)) { - if (s[i].getSequence().length() > j) + if (s[i].getSequence().length > j) { - out.append(s[i].getSequence().substring(j, j + 1)); + out.append(s[i].getSequenceAsString(j, j + 1)); } else {