X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2FFeaturesFileTest.java;h=77c18dbd054cf19f2367ca9f241026d6bac8a854;hb=refs%2Fheads%2Ftask%2FJAL-3243_PDB_free_text_error;hp=ab0728943d3d6ba26ea12d7558a6042fb93da532;hpb=84ed42e8d0aa07b03441b045d240ebb51f94c53c;p=jalview.git diff --git a/test/jalview/io/FeaturesFileTest.java b/test/jalview/io/FeaturesFileTest.java index ab07289..77c18db 100644 --- a/test/jalview/io/FeaturesFileTest.java +++ b/test/jalview/io/FeaturesFileTest.java @@ -481,13 +481,15 @@ public class FeaturesFileTest assertEquals(expected, exported); /* - * include non-positional features + * include non-positional features, but still no positional features */ fr.setGroupVisibility("uniprot", true); exported = featuresFile.printJalviewFormat(al.getSequencesArray(), fr, true); - expected = "Cath\tFER_CAPAA\t-1\t0\t0\tDomain\t0.0\n" - + "desc1\tFER_CAPAN\t-1\t0\t0\tPfam\t1.3\n" + expected = "\nSTARTGROUP\tuniprot\n" + + "Cath\tFER_CAPAA\t-1\t0\t0\tDomain\t0.0\n" + + "ENDGROUP\tuniprot\n\n" + + "desc1\tFER_CAPAN\t-1\t0\t0\tPfam\t1.3\n\n" + "desc3\tFER1_SOLLC\t-1\t0\t0\tPfam\n"; // NaN is not output assertEquals(expected, exported); @@ -513,7 +515,7 @@ public class FeaturesFileTest exported = featuresFile.printJalviewFormat(al.getSequencesArray(), fr, false); /* - * features are output within group, ordered by sequence and by type + * features are output within group, ordered by sequence and type */ expected = "METAL\tcc9900\n" + "Pfam\tff0000\n" @@ -523,9 +525,36 @@ public class FeaturesFileTest + "Iron\tFER_CAPAA\t-1\t39\t39\tMETAL\t0.0\n" + "Pfam domainPfam_3_4\tFER_CAPAA\t-1\t20\t20\tPfam\t0.0\n" + "ENDGROUP\tuniprot\n" - // null / empty group features output after features in named - // groups: + // null / empty group features are output after named groups + + "\ndesc2\tFER_CAPAN\t-1\t4\t9\tPfam\n" + + "\ndesc4\tFER1_SOLLC\t-1\t5\t8\tPfam\t-2.6\n"; + assertEquals(expected, exported); + + /* + * hide uniprot group + */ + fr.setGroupVisibility("uniprot", false); + expected = "METAL\tcc9900\n" + "Pfam\tff0000\n" + + "GAMMA-TURN\tscore|ff0000|00ffff|noValueMin|20.0|95.0|below|66.0\n" + + "\ndesc2\tFER_CAPAN\t-1\t4\t9\tPfam\n" + + "\ndesc4\tFER1_SOLLC\t-1\t5\t8\tPfam\t-2.6\n"; + exported = featuresFile.printJalviewFormat(al.getSequencesArray(), fr, + false); + assertEquals(expected, exported); + + /* + * include non-positional (overrides group not shown) + */ + exported = featuresFile.printJalviewFormat(al.getSequencesArray(), fr, + true); + expected = "METAL\tcc9900\n" + "Pfam\tff0000\n" + + "GAMMA-TURN\tscore|ff0000|00ffff|noValueMin|20.0|95.0|below|66.0\n" + + "\nSTARTGROUP\tuniprot\n" + + "Cath\tFER_CAPAA\t-1\t0\t0\tDomain\t0.0\n" + + "ENDGROUP\tuniprot\n" + + "\ndesc1\tFER_CAPAN\t-1\t0\t0\tPfam\t1.3\n" + "desc2\tFER_CAPAN\t-1\t4\t9\tPfam\n" + + "\ndesc3\tFER1_SOLLC\t-1\t0\t0\tPfam\n" + "desc4\tFER1_SOLLC\t-1\t5\t8\tPfam\t-2.6\n"; assertEquals(expected, exported); } @@ -750,7 +779,7 @@ public class FeaturesFileTest /* * now threshold to Score > 1.1 - should exclude sf2 */ - FeatureColourI fc = new FeatureColour(Color.white, Color.BLACK, + FeatureColourI fc = new FeatureColour(null, Color.white, Color.BLACK, Color.white, 0f, 2f); fc.setAboveThreshold(true); fc.setThreshold(1.1f); @@ -826,7 +855,7 @@ public class FeaturesFileTest * now threshold to Score > 1.1 - should exclude sf2 * (and there should be no empty STARTGROUP/ENDGROUP output) */ - FeatureColourI fc = new FeatureColour(Color.white, Color.BLACK, + FeatureColourI fc = new FeatureColour(null, Color.white, Color.BLACK, Color.white, 0f, 2f); fc.setAboveThreshold(true); fc.setThreshold(1.1f);