X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FClustalFile.java;h=5d7be8c52a9ba25275a8559fec5799b099cb6b4b;hb=7000ea3223f2f6a390f56341ba26850d2a137ae0;hp=e72e0df32df2db9c21a6f78fbb39d2d7e2f199a3;hpb=55e2e9b22b133db8b9ff0979b0338a33081fc8fd;p=jalview.git diff --git a/src/jalview/io/ClustalFile.java b/src/jalview/io/ClustalFile.java index e72e0df..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 { @@ -49,6 +44,7 @@ public class ClustalFile } public void parse() + throws IOException { int i = 0; boolean flag = false; @@ -102,7 +98,9 @@ public class ClustalFile } } else + { flag = true; + } } } } @@ -129,7 +127,8 @@ public class ClustalFile } Sequence newSeq = parseId(headers.elementAt(i).toString()); - newSeq.setSequence( seqhash.get(headers.elementAt(i).toString()).toString() ); + newSeq.setSequence(seqhash.get(headers.elementAt(i).toString()). + toString()); seqs.addElement(newSeq); } @@ -161,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) @@ -190,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)); } }