X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FColumnSelection.java;h=309aabfce991073fa492acc5a47826bc8d64c7a1;hb=2a49f71b0cf62de3942ad625995244db3f291dc6;hp=140a3661033f9a46d496415654aa98bf3d3cb549;hpb=b197088233e07bcdbf41a12e975185aee3efe146;p=jalview.git diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index 140a366..309aabf 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -559,9 +559,10 @@ public class ColumnSelection * @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(); @@ -572,22 +573,36 @@ public class ColumnSelection 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; }