import jalview.api.AlignExportSettingI;
import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+import java.io.IOException;
+
/**
* Additional formatting methods used by the application in a number of places.
*
annotFromStructure = jalview.bin.Cache.getDefault("ADD_TEMPFACT_ANN",
true);
localSecondaryStruct = jalview.bin.Cache.getDefault("ADD_SS_ANN",
- true);
- serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW",
- true);
+ true);
+ serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW",
+ true);
}
else
{
{
startRes = seqs[i].getStart();
endRes = seqs[i].getEnd();
-
-
if (startEnd != null)
{
startIndex = startEnd[0];
}
startRes = seqs[i].findPosition(startIndex);
- startRes = seqs[i].getStart() > 1 ? startRes - seqs[i].getStart()
- : startRes;
- endRes = seqs[i].findPosition(endIndex) - seqs[i].getStart();
+ endRes = seqs[i].findPosition(endIndex);
}
tmp[i] = new Sequence(seqs[i].getName(), omitHiddenColumns[i],
return null;
}
- public boolean getCacheSuffixDefault(String format)
+ public boolean getCacheSuffixDefault(FileFormatI format)
{
if (isValidFormat(format))
{
- return jalview.bin.Cache.getDefault(format.toUpperCase()
+ return Cache.getDefault(format.toUpperCase()
+ "_JVSUFFIX", true);
}
return false;
}
- public String formatSequences(String format, AlignmentI alignment,
+ public String formatSequences(FileFormatI format, AlignmentI alignment,
String[] omitHidden, int[] exportRange, ColumnSelection colSel)
{
return formatSequences(format, alignment, omitHidden, exportRange,
getCacheSuffixDefault(format), colSel, null);
}
- public String formatSequences(String format, AlignmentI alignment,
+ public String formatSequences(FileFormatI format, AlignmentI alignment,
String[] omitHidden, int[] exportRange, ColumnSelection colSel,
SequenceGroup sgp)
{
* defines hidden columns that are edited out of annotation
* @return string representation of the alignment formatted as format
*/
- public String formatSequences(String format, AlignmentI alignment,
+ public String formatSequences(FileFormatI format, AlignmentI alignment,
String[] omitHidden, int[] exportRange, boolean suffix,
ColumnSelection colSel)
{
return formatSequences(format, alignment, omitHidden, exportRange,
- suffix, colSel,
- null);
+ suffix, colSel, null);
}
- public String formatSequences(String format, AlignmentI alignment,
+ public String formatSequences(FileFormatI format, AlignmentI alignment,
String[] omitHidden, int[] exportRange, boolean suffix,
- ColumnSelection colSel,
- jalview.datamodel.SequenceGroup selgp)
+ ColumnSelection colSel, SequenceGroup selgp)
{
if (omitHidden != null)
{
return this.formatSequences(format, alignment, suffix);
}
- public AlignmentI readFile(String inFile, String type, String format)
- throws java.io.IOException
+ @Override
+ public AlignmentI readFile(String file, DataSourceType sourceType,
+ FileFormatI fileFormat) throws IOException
{
- AlignmentI al = super.readFile(inFile, type, format);
+ AlignmentI al = super.readFile(file, sourceType, fileFormat);
return al;
}
- public AlignmentI readFromFile(FileParse source, String format)
- throws java.io.IOException
+ @Override
+ public AlignmentI readFromFile(FileParse source, FileFormatI format)
+ throws IOException
{
AlignmentI al = super.readFromFile(source, format);
return al;
* alignment panel originating the view
* @return String containing flat file
*/
- public String formatSequences(String format, AlignmentViewPanel ap,
+ public String formatSequences(FileFormatI format, AlignmentViewPanel ap,
boolean selectedOnly)
{
return formatSequences(format, getCacheSuffixDefault(format), ap,
selectedOnly);
}
-
}