From 43c78e88653d6b6d14920abf9fa23733ece55c1f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 15 Jun 2015 18:52:02 +0100 Subject: [PATCH] JAL-1665 patch for regression: failing jalview.ws.jabaws.DisorderAnnotExportImport due to different sequence features in original and reimported alignment (originally, sequence features were not available on local sequenceI) --- test/jalview/io/AnnotationFileIOTest.java | 2 +- test/jalview/io/PhylipFileTests.java | 2 +- test/jalview/io/StockholmFileTest.java | 12 ++++++++---- test/jalview/ws/jabaws/DisorderAnnotExportImport.java | 2 +- test/jalview/ws/jabaws/JpredJabaStructExportImport.java | 2 +- test/jalview/ws/jabaws/RNAStructExportImport.java | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/test/jalview/io/AnnotationFileIOTest.java b/test/jalview/io/AnnotationFileIOTest.java index 0962452..0e066c2 100644 --- a/test/jalview/io/AnnotationFileIOTest.java +++ b/test/jalview/io/AnnotationFileIOTest.java @@ -144,7 +144,7 @@ public class AnnotationFileIOTest FormatAdapter.PASTE)); // test for consistency in io - StockholmFileTest.testAlignmentEquivalence(al, al_new); + StockholmFileTest.testAlignmentEquivalence(al, al_new, false); return; } catch (Exception e) { diff --git a/test/jalview/io/PhylipFileTests.java b/test/jalview/io/PhylipFileTests.java index 70e3f2c..e411272 100644 --- a/test/jalview/io/PhylipFileTests.java +++ b/test/jalview/io/PhylipFileTests.java @@ -160,7 +160,7 @@ public class PhylipFileTests AppletFormatAdapter.PASTE, PhylipFile.FILE_DESC); assertNotNull("Couldn't parse reimported alignment data.", al_input); - StockholmFileTest.testAlignmentEquivalence(al, al_input); + StockholmFileTest.testAlignmentEquivalence(al, al_input, false); } } \ No newline at end of file diff --git a/test/jalview/io/StockholmFileTest.java b/test/jalview/io/StockholmFileTest.java index 3bf0952..806e4dc 100644 --- a/test/jalview/io/StockholmFileTest.java +++ b/test/jalview/io/StockholmFileTest.java @@ -119,7 +119,7 @@ public class StockholmFileTest "Identify routine could not recognise output generated by '" + ioformat + "' writer", ioformat.equals(identifyoutput)); - testAlignmentEquivalence(al, al_input); + testAlignmentEquivalence(al, al_input, false); int numaliannot = 0, numsqswithali = 0; for (AlignmentAnnotation ala : al_input.getAlignmentAnnotation()) { @@ -157,9 +157,11 @@ public class StockholmFileTest * @param al_input * 'secondary' or generated alignment from some datapreserving * transformation + * @param ignoreFeatures + * when true, differences in seuqence feature annotation are ignored. */ public static void testAlignmentEquivalence(AlignmentI al, - AlignmentI al_input) + AlignmentI al_input, boolean ignoreFeatures) { assertNotNull("Original alignment was null", al); assertNotNull("Generated alignment was null", al_input); @@ -261,8 +263,10 @@ public class StockholmFileTest + " are not equal", ss_original.equals(ss_new)); assertTrue( - "Sequence Features were not equivalent", - (seq_original[i].getSequenceFeatures() == null && seq_new[in] + "Sequence Features were not equivalent" + + (ignoreFeatures ? " ignoring." : ""), + ignoreFeatures + || (seq_original[i].getSequenceFeatures() == null && seq_new[in] .getSequenceFeatures() == null) || (seq_original[i].getSequenceFeatures() != null && seq_new[in] .getSequenceFeatures() != null)); diff --git a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java index 6076dec..e561479 100644 --- a/test/jalview/ws/jabaws/DisorderAnnotExportImport.java +++ b/test/jalview/ws/jabaws/DisorderAnnotExportImport.java @@ -151,7 +151,7 @@ public class DisorderAnnotExportImport FormatAdapter.PASTE)); // test for consistency in io - StockholmFileTest.testAlignmentEquivalence(al, al_new); + StockholmFileTest.testAlignmentEquivalence(al, al_new, true); return; } catch (Exception e) { diff --git a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java index c522bc3..7afaeed 100644 --- a/test/jalview/ws/jabaws/JpredJabaStructExportImport.java +++ b/test/jalview/ws/jabaws/JpredJabaStructExportImport.java @@ -215,7 +215,7 @@ public class JpredJabaStructExportImport FormatAdapter.PASTE)); // test for consistency in io - StockholmFileTest.testAlignmentEquivalence(al, al_new); + StockholmFileTest.testAlignmentEquivalence(al, al_new, false); return; } catch (Exception e) { diff --git a/test/jalview/ws/jabaws/RNAStructExportImport.java b/test/jalview/ws/jabaws/RNAStructExportImport.java index 665d9c8..1475b4e 100644 --- a/test/jalview/ws/jabaws/RNAStructExportImport.java +++ b/test/jalview/ws/jabaws/RNAStructExportImport.java @@ -210,7 +210,7 @@ public class RNAStructExportImport FormatAdapter.PASTE)); // test for consistency in io - StockholmFileTest.testAlignmentEquivalence(al, al_new); + StockholmFileTest.testAlignmentEquivalence(al, al_new, false); return; } catch (Exception e) { -- 1.7.10.2