headers.addElement(id);\r
}\r
\r
- tempseq.append(str.nextToken());\r
+ if(str.hasMoreTokens())\r
+ tempseq.append(str.nextToken());\r
}\r
}\r
}\r
return print(getSeqsAsArray());\r
}\r
public static String print(SequenceI[] s) {\r
+\r
StringBuffer out = new StringBuffer("CLUSTAL\n\n");\r
\r
int max = 0;\r
int start = i*len;\r
int end = start + len;\r
\r
- if (end < s[j].getSequence().length() && start < s[j].getSequence().length() ) {\r
- out.append(s[j].getSequence().substring(start,end) + "\n");\r
- } else {\r
- if (start < s[j].getSequence().length()) {\r
- out.append(s[j].getSequence().substring(start) + "\n");\r
- }\r
+ if (end < s[j].getSequence().length() && start < s[j].getSequence().length() )\r
+ out.append(s[j].getSequence().substring(start,end));\r
+ else\r
+ {\r
+ if (start < s[j].getSequence().length())\r
+ out.append(s[j].getSequence().substring(start));\r
}\r
+ out.append("\n");\r
j++;\r
}\r
out.append("\n");\r
\r
}\r
+\r
return out.toString();\r
}\r
\r