}
FormatAdapter f = new FormatAdapter();
String output = f.formatSequences(format,
- (Alignment) viewport.alignment, // class cast exceptions will
+ viewport.alignment, // class cast exceptions will
// occur in the distant future
omitHidden, f.getCacheSuffixDefault(format), viewport.colSel);
{
try
{
- sg.cs = (ColourSchemeI) cs.getClass().newInstance();
+ sg.cs = cs.getClass().newInstance();
} catch (Exception ex)
{
}
try
{
TCoffeeScoreFile result = TCoffeeScoreFile.load(new File(sFilePath));
- if( result == null ) { throw new RuntimeException("The file provided does not match the T-Coffee scores file format"); }
-
- // TODO check that the loaded scores matches the current MSA 'dimension'
+ if( result == null ) {
+ // TODO: raise a dialog box here rather than bomb out.
+
+ throw new RuntimeException("The file provided does not match the T-Coffee scores file format");
+ }
+
+ /*
+ * check that the score matrix matches the alignment dimensions
+ */
+ AlignmentI aln;
+ if( (aln=viewport.alignment) != null && (aln.getHeight() != result.getHeight() || aln.getWidth() != result.getWidth()) ) {
+ // TODO: raise a dialog box here rather than bomb out.
+ throw new RuntimeException("The scores matrix does not match the alignment dimensions");
+ }
if (result.annotateAlignment(alignPanel.getAlignment(), true))
{
tcoffeeColour.setEnabled(true);