X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FClustalFile.java;h=5d7be8c52a9ba25275a8559fec5799b099cb6b4b;hb=7000ea3223f2f6a390f56341ba26850d2a137ae0;hp=30c14004e64b970423da2d37408a7429b49ebaf5;hpb=04011072920c5e2587a8d549869ee47e28ad7d81;p=jalview.git diff --git a/src/jalview/io/ClustalFile.java b/src/jalview/io/ClustalFile.java index 30c1400..5d7be8c 100755 --- a/src/jalview/io/ClustalFile.java +++ b/src/jalview/io/ClustalFile.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) 2007 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 @@ -43,7 +43,8 @@ public class ClustalFile super.initData(); } - public void parse() throws IOException + public void parse() + throws IOException { int i = 0; boolean flag = false; @@ -97,7 +98,9 @@ public class ClustalFile } } else + { flag = true; + } } } } @@ -124,15 +127,8 @@ public class ClustalFile } Sequence newSeq = parseId(headers.elementAt(i).toString()); - newSeq.setSequence( seqhash.get(headers.elementAt(i).toString()).toString() ); - - if (!isValidProteinSequence(newSeq.getSequence())) - { - throw new IOException(AppletFormatAdapter.INVALID_CHARACTERS - + " : " + newSeq.getName() - + " : " + invalidCharacter); - } - + newSeq.setSequence(seqhash.get(headers.elementAt(i).toString()). + toString()); seqs.addElement(newSeq); } @@ -164,9 +160,9 @@ public class ClustalFile { String tmp = printId(s[i]); - if (s[i].getSequence().length() > max) + if (s[i].getSequence().length > max) { - max = s[i].getSequence().length(); + max = s[i].getSequence().length; } if (tmp.length() > maxid) @@ -193,21 +189,21 @@ public class ClustalFile while ( (j < s.length) && (s[j] != null)) { - out.append(new Format("%-" + maxid + "s").form( printId(s[j]) + " ")); + out.append(new Format("%-" + maxid + "s").form(printId(s[j]) + " ")); int start = i * len; int end = start + len; - if ( (end < s[j].getSequence().length()) && - (start < s[j].getSequence().length())) + if ( (end < s[j].getSequence().length) && + (start < s[j].getSequence().length)) { - out.append(s[j].getSequence().substring(start, end)); + out.append(s[j].getSequenceAsString(start, end)); } else { - if (start < s[j].getSequence().length()) + if (start < s[j].getSequence().length) { - out.append(s[j].getSequence().substring(start)); + out.append(s[j].getSequenceAsString().substring(start)); } }