From b2737b5de2d79cdf6a4b33f63acf746d0260f45a Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 22 May 2017 13:02:47 +0100 Subject: [PATCH] JAL-2490 add non-positional feature case to test prior to refactoring --- test/jalview/io/FeaturesFileTest.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/test/jalview/io/FeaturesFileTest.java b/test/jalview/io/FeaturesFileTest.java index d6f1e8b..be5e68d 100644 --- a/test/jalview/io/FeaturesFileTest.java +++ b/test/jalview/io/FeaturesFileTest.java @@ -406,6 +406,7 @@ public class FeaturesFileTest + "GAMMA-TURN\tred|0,255,255|20.0|95.0|below|66.0\n" + "Pfam\tred\n" + "STARTGROUP\tuniprot\n" + + "Cath\tFER_CAPAA\t-1\t0\t0\tDomain\n" // non-positional feature + "Iron\tFER_CAPAA\t-1\t39\t39\tMETAL\n" + "Turn\tFER_CAPAA\t-1\t36\t38\tGAMMA-TURN\n" + "Pfam domainPfam_3_4\tFER_CAPAA\t-1\t20\t20\tPfam\n" @@ -415,23 +416,33 @@ public class FeaturesFileTest featuresFile.parse(al.getDataset(), colours, false); /* - * first with no features displayed + * first with no features displayed, exclude non-positional features */ FeatureRenderer fr = af.alignPanel.getFeatureRenderer(); Map visible = fr.getDisplayedFeatureCols(); String exported = featuresFile.printJalviewFormat( - al.getSequencesArray(), visible); + al.getSequencesArray(), visible, true, false); String expected = "No Features Visible"; assertEquals(expected, exported); /* + * include non-positional features + */ + af.getViewport().setShowNPFeats(true); + exported = featuresFile.printJalviewFormat(al.getSequencesArray(), + visible, true, true); + expected = "\nSTARTGROUP\tuniprot\nCath\tFER_CAPAA\t-1\t0\t0\tDomain\t0.0\nENDGROUP\tuniprot\n"; + assertEquals(expected, exported); + + /* * set METAL (in uniprot group) and GAMMA-TURN visible, but not Pfam */ + af.getViewport().setShowNPFeats(false); fr.setVisible("METAL"); fr.setVisible("GAMMA-TURN"); visible = fr.getDisplayedFeatureCols(); exported = featuresFile.printJalviewFormat(al.getSequencesArray(), - visible); + visible, true, false); expected = "METAL\tcc9900\n" + "GAMMA-TURN\tff0000|00ffff|20.0|95.0|below|66.0\n" + "\nSTARTGROUP\tuniprot\n" @@ -446,7 +457,7 @@ public class FeaturesFileTest fr.setVisible("Pfam"); visible = fr.getDisplayedFeatureCols(); exported = featuresFile.printJalviewFormat(al.getSequencesArray(), - visible); + visible, true, false); /* * note the order of feature types is uncontrolled - derives from * FeaturesDisplayed.featuresDisplayed which is a HashSet -- 1.7.10.2