* @param filterParams
* @return
*/
- public int filterAnnotations(Annotation[] annotations,
+ public int filterAnnotations(AlignmentAnnotation ann_row,
AnnotationFilterParameter filterParams)
{
+ Annotation[] annotations = ann_row.annotations;
// JBPNote - this method needs to be refactored to become independent of
// viewmodel package
this.clear();
Annotation ann = annotations[column];
if (ann != null)
{
+ float value = ann.value;
boolean matched = false;
/*
* filter may have multiple conditions -
* these are or'd until a match is found
*/
+ if (ann_row.graph == AlignmentAnnotation.CUSTOMRENDERER)
+ {
+ if (ann_row.sequenceRef != null)
+ {
+ int cpos = ann_row.sequenceRef.findPosition(column) - 1;
+ ContactListI clist = ann_row.sequenceRef
+ .getContactListFor(ann_row, cpos);
+ ContactRange crange = clist.getRangeFor(0,
+ clist.getContactHeight());
+ value = (float) crange.getMean();
+ }
+ }
+
if (filterParams
.getThresholdType() == AnnotationFilterParameter.ThresholdType.ABOVE_THRESHOLD
- && ann.value > filterParams.getThresholdValue())
+ && value > filterParams.getThresholdValue())
{
matched = true;
}
if (!matched && filterParams
.getThresholdType() == AnnotationFilterParameter.ThresholdType.BELOW_THRESHOLD
- && ann.value < filterParams.getThresholdValue())
+ && value < filterParams.getThresholdValue())
{
matched = true;
}