* @return a GlyphI
* @see com.affymetrix.genoviz.glyph.StretchContainerGlyph
* @see com.affymetrix.genoviz.bioviews.GlyphI
*/
GlyphI getSummaryGlyph(Collection<GlyphI> glyphsToSummarize) {
GlyphI summaryGlyph = new StretchContainerGlyph();
int[] transitions = determineTransitions(glyphsToSummarize);
int[] unique_transitions = determineUniqueTransitions(transitions);
int segCount = unique_transitions.length - 1;
for (int i = 0; i < segCount; i++) {
/**
* Construct a glyph summarySegment for every sequential pair of transition points,
* with x = array[i] and width = array[i+1] - array[i],
* and y = FLOAT_MIN/2 and height = FLOAT_MAX (???)
*/
int segStart = unique_transitions[i];
int segEnd = unique_transitions[i + 1];
GlyphI newgl = new FillRectGlyph();
newgl.setColor(glyph_color);
int hitCount = determineGlyphHits(glyphsToSummarize, segEnd, segStart);
/**
* reset y = 0 and height = # of hits
*/
// newgl.setCoords(segStart, 0, segEnd - segStart, hitCount);
// just hardwiring height multiple till get normalization code implemented
// newgl.setCoords(segStart, 0, segEnd - segStart, hitCount*10);
// if want to filter out regions with no hits, uncomment out conditional
newgl.setCoords(segStart, -hitCount * scale_factor, segEnd - segStart, hitCount * scale_factor);
summaryGlyph.addChild(newgl);
}
/**
* 5) normalize height somehow...
* NOT YET IMPLEMENTED