*/
package jalview.workers;
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.List;
+
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
+import jalview.datamodel.MappedFeatures;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.renderer.seqfeatures.FeatureRenderer;
import jalview.util.ColorUtils;
import jalview.util.Comparison;
-import java.awt.Color;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* A class to compute alignment annotations with column counts for a set of
* properties of interest on positions in an alignment. <br>
max[crow] = 0;
}
- int[] minC = counter.getMinColour();
- int[] maxC = counter.getMaxColour();
- Color minColour = new Color(minC[0], minC[1], minC[2]);
- Color maxColour = new Color(maxC[0], maxC[1], maxC[2]);
-
for (int col = 0; col < width; col++)
{
int[] count = counts[col];
for (int anrow = 0; anrow < rows; anrow++)
{
+ int[] minC = counter.getMinColour(anrow);
+ int[] maxC = counter.getMaxColour(anrow);
+ Color minColour = new Color(minC[0], minC[1], minC[2]);
+ Color maxColour = new Color(maxC[0], maxC[1], maxC[2]);
+
Annotation[] anns = new Annotation[width];
long rmax = 0;
/*
return annotationAdded;
}
+ void removeOldAnnotations(String[] annotDescs)
+ {
+ // TODO use the commented out code once JAL-2075 is fixed
+ // to get adequate performance on genomic length sequence
+ AlignmentI alignment = alignViewport.getAlignment();
+ ArrayList<AlignmentAnnotation> toRemove = new ArrayList<AlignmentAnnotation>();
+ for (String toRemoveDesc : annotDescs)
+ {
+ for (AlignmentAnnotation aa : ourAnnots)
+ {
+ if (toRemoveDesc.equals(aa.getCalcId()))
+ toRemove.add(aa);
+ }
+ }
+ for (AlignmentAnnotation deleted : toRemove)
+ {
+ alignment.deleteAnnotation(deleted);
+ }
+ }
+
/**
* Returns a count of any feature types present at the specified position of
* the alignment
*/
// see JAL-2075
List<SequenceFeature> features = fr.findFeaturesAtColumn(seq, col + 1);
+ if (fr.hasRenderOrder())
+ {
+ MappedFeatures mappedFeatres = fr.findComplementFeaturesAtResidue(seq,
+ seq.findPosition(col));
+ features.addAll(mappedFeatres.features);
+ }
int[] count = this.counter.count(String.valueOf(res), features);
return count;
}