fr.filterFeaturesForDisplay(features, null); // empty list, does nothing
SequenceI seq = av.getAlignment().getSequenceAt(0);
- SequenceFeature sf1 = new SequenceFeature("Cath", "", 6, 8, "group1");
+ SequenceFeature sf1 = new SequenceFeature("Cath", "", 6, 8, Float.NaN,
+ "group1");
seq.addSequenceFeature(sf1);
- SequenceFeature sf2 = new SequenceFeature("Cath", "", 5, 11, "group2");
+ SequenceFeature sf2 = new SequenceFeature("Cath", "", 5, 11, 2f,
+ "group2");
seq.addSequenceFeature(sf2);
- SequenceFeature sf3 = new SequenceFeature("Cath", "", 5, 11, "group3");
+ SequenceFeature sf3 = new SequenceFeature("Cath", "", 5, 11, 3f,
+ "group3");
seq.addSequenceFeature(sf3);
- SequenceFeature sf4 = new SequenceFeature("Cath", "", 6, 8, "group4");
+ SequenceFeature sf4 = new SequenceFeature("Cath", "", 6, 8, 4f,
+ "group4");
seq.addSequenceFeature(sf4);
- SequenceFeature sf5 = new SequenceFeature("Cath", "", 6, 9, "group4");
+ SequenceFeature sf5 = new SequenceFeature("Cath", "", 6, 9, 5f,
+ "group4");
seq.addSequenceFeature(sf5);
fr.findAllFeatures(true);
/*
* no filtering of co-located features with graduated colour scheme
+ * filterFeaturesForDisplay does _not_ check colour threshold
* sf2 is removed as its group is hidden
*/
features = seq.getSequenceFeatures();
150f);
SequenceFeature sf = new SequenceFeature("type", "desc", 0, 20, 70f,
null);
+
+ /*
+ * feature with score of Float.NaN is always assigned minimum colour
+ */
+ SequenceFeature sf2 = new SequenceFeature("type", "desc", 0, 20,
+ Float.NaN, null);
+
fc.setThreshold(100f); // ignore for now
assertEquals(new Color(204, 204, 204), fc.getColor(sf));
+ assertEquals(Color.white, fc.getColor(sf2));
fc.setAboveThreshold(true); // feature lies below threshold
assertNull(fc.getColor(sf));
+ assertEquals(Color.white, fc.getColor(sf2));
fc.setBelowThreshold(true);
fc.setThreshold(70f);
assertNull(fc.getColor(sf)); // feature score == threshold - hidden
+ assertEquals(Color.white, fc.getColor(sf2));
fc.setThreshold(69f);
assertNull(fc.getColor(sf)); // feature score > threshold - hidden
+ assertEquals(Color.white, fc.getColor(sf2));
}
/**