X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFormatAdapter.java;h=6d3c18aef394432234a8f9071afb9aec6f1f8b20;hb=8c5cefb3ac80bd094a8dab7ce6735a11583b1772;hp=ce584f2ca44b1441b32514a0e539261f344af912;hpb=95ebbef7b78bf266a8252bd479510be3c80cd234;p=jalview.git diff --git a/src/jalview/io/FormatAdapter.java b/src/jalview/io/FormatAdapter.java index ce584f2..6d3c18a 100755 --- a/src/jalview/io/FormatAdapter.java +++ b/src/jalview/io/FormatAdapter.java @@ -26,7 +26,7 @@ import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; -import jalview.datamodel.ColumnSelection; +import jalview.datamodel.HiddenColumns; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; @@ -116,8 +116,8 @@ public class FormatAdapter extends AppletFormatAdapter startIndex = startEnd[0]; endIndex = startEnd[1]; // get first non-gaped residue start position - while (Comparison.isGap(seqs[i] - .getCharAt(startIndex)) && startIndex < endIndex) + while (Comparison.isGap(seqs[i].getCharAt(startIndex)) + && startIndex < endIndex) { startIndex++; } @@ -161,18 +161,19 @@ public class FormatAdapter extends AppletFormatAdapter public boolean getCacheSuffixDefault(FileFormatI format) { - return Cache.getDefault(format.getName() + "_JVSUFFIX", true); + return Cache.getDefault(format.getName().toUpperCase() + "_JVSUFFIX", + true); } public String formatSequences(FileFormatI format, AlignmentI alignment, - String[] omitHidden, int[] exportRange, ColumnSelection colSel) + String[] omitHidden, int[] exportRange, HiddenColumns hidden) { return formatSequences(format, alignment, omitHidden, exportRange, - getCacheSuffixDefault(format), colSel, null); + getCacheSuffixDefault(format), hidden, null); } /** - * hack function to replace seuqences with visible sequence strings before + * hack function to replace sequences with visible sequence strings before * generating a string of the alignment in the given format. * * @param format @@ -185,15 +186,15 @@ public class FormatAdapter extends AppletFormatAdapter */ public String formatSequences(FileFormatI format, AlignmentI alignment, String[] omitHidden, int[] exportRange, boolean suffix, - ColumnSelection colSel) + HiddenColumns hidden) { return formatSequences(format, alignment, omitHidden, exportRange, - suffix, colSel, null); + suffix, hidden, null); } public String formatSequences(FileFormatI format, AlignmentI alignment, String[] omitHidden, int[] exportRange, boolean suffix, - ColumnSelection colSel, SequenceGroup selgp) + HiddenColumns hidden, SequenceGroup selgp) { if (omitHidden != null) { @@ -211,12 +212,12 @@ public class FormatAdapter extends AppletFormatAdapter AlignmentAnnotation na = new AlignmentAnnotation(ala[i]); if (selgp != null) { - colSel.makeVisibleAnnotation(selgp.getStartRes(), - selgp.getEndRes(), na); + na.makeVisibleAnnotation(selgp.getStartRes(), selgp.getEndRes(), + hidden); } else { - colSel.makeVisibleAnnotation(na); + na.makeVisibleAnnotation(hidden); } alv.addAnnotation(na); } @@ -258,8 +259,8 @@ public class FormatAdapter extends AppletFormatAdapter selectedOnly); } - public AlignmentI readFromFile(AlignmentFileI source, FileFormatI format) - throws IOException + public AlignmentI readFromFile(AlignmentFileReaderI source, + FileFormatI format) throws IOException { FileParse fp = new FileParse(source.getInFile(), source.getDataSourceType());