X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FClustalFile.java;h=5d7be8c52a9ba25275a8559fec5799b099cb6b4b;hb=ce886100c1eae01eac7d59c961e694f4493d4bcb;hp=2ea1d2f3017c8588b0fe60745fd4cf153ba70520;hpb=8d3d3b4edf47e543b8b352c1b2c247cfc59122a4;p=jalview.git diff --git a/src/jalview/io/ClustalFile.java b/src/jalview/io/ClustalFile.java index 2ea1d2f..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 @@ -32,11 +32,6 @@ public class ClustalFile { } - public ClustalFile(String inStr) - { - super(inStr); - } - public ClustalFile(String inFile, String type) throws IOException { @@ -48,7 +43,8 @@ public class ClustalFile super.initData(); } - public void parse() throws IOException + public void parse() + throws IOException { int i = 0; boolean flag = false; @@ -102,7 +98,9 @@ public class ClustalFile } } else + { flag = true; + } } } } @@ -129,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); } @@ -169,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) @@ -198,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)); } }