X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FClustalFile.java;h=5d58d423cd8b73ef0edab08c0761ee139cc3d120;hb=b8cd52fe7bed59130e5b080acfd42c3ef2effdbb;hp=41fe12b29d239d653e032ebd0ac66d82e41c412c;hpb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;p=jalview.git diff --git a/src/jalview/io/ClustalFile.java b/src/jalview/io/ClustalFile.java index 41fe12b..5d58d42 100755 --- a/src/jalview/io/ClustalFile.java +++ b/src/jalview/io/ClustalFile.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -37,9 +37,10 @@ public class ClustalFile extends AlignFile { } - public ClustalFile(String inFile, String type) throws IOException + public ClustalFile(String inFile, DataSourceType sourceType) + throws IOException { - super(inFile, type); + super(inFile, sourceType); } public ClustalFile(FileParse source) throws IOException @@ -47,11 +48,13 @@ public class ClustalFile extends AlignFile super(source); } + @Override public void initData() { super.initData(); } + @Override public void parse() throws IOException { int i = 0; @@ -193,13 +196,8 @@ public class ClustalFile extends AlignFile } } - public String print() - { - return print(getSeqsAsArray()); - // TODO: locaRNA style aln output - } - - public String print(SequenceI[] s) + @Override + public String print(SequenceI[] s, boolean jvsuffix) { StringBuffer out = new StringBuffer("CLUSTAL" + newline + newline); @@ -210,7 +208,7 @@ public class ClustalFile extends AlignFile while ((i < s.length) && (s[i] != null)) { - String tmp = printId(s[i]); + String tmp = printId(s[i], jvsuffix); if (s[i].getSequence().length > max) { @@ -233,7 +231,7 @@ public class ClustalFile extends AlignFile maxid++; int len = 60; - int nochunks = (max / len) + 1; + int nochunks = (max / len) + (max % len > 0 ? 1 : 0); for (i = 0; i < nochunks; i++) { @@ -241,7 +239,8 @@ public class ClustalFile extends AlignFile 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], + jvsuffix) + " ")); int start = i * len; int end = start + len;