seqannot = new IdentityHashMap<SequenceI, AlignmentAnnotation>();
}
// resolve the context containing all the annotation for the sequence
- AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment
+ AnnotatedCollectionI alcontext = alignment instanceof AlignmentI
+ ? alignment
: alignment.getContext();
- boolean f = true, rna = false;
- for (AlignmentAnnotation alan : alcontext
- .findAnnotation(annotation.getCalcId()))
+ boolean f = true, sf = true, rna = false;
+ long plcount = 0, ancount = 0;
+ for (AlignmentAnnotation alan : alcontext.findAnnotation(annotation
+ .getCalcId()))
{
if (alan.sequenceRef != null
- && (alan.label != null && annotation != null && alan.label
- .equals(annotation.label)))
+ && (alan.label != null && annotation != null
+ && alan.label.equals(annotation.label)))
{
+ ancount++;
if (!rna && alan.isRNA())
{
rna = true;
}
}
- float aamin = 0f, aamax = 0f;
+ /**
+ * positional annotation max/min
+ */
+ double aamin = 0.0, aamax = 0.0;
+
+ /**
+ * per line score max/min
+ */
+ double plmin = Double.NaN, plmax = Double.NaN;
- public String getAnnotation()
+ public AlignmentAnnotation getAnnotation()
{
- return annotation.label;
+ return annotation;
}
public int getAboveThreshold()
range = 0f;
}
}
+
- int dr = (int) (redRange * range + redMin);
- int dg = (int) (greenRange * range + greenMin);
- int db = (int) (blueRange * range + blueMin);
-
- return new Color(dr, dg, db);
+ // midtr sets the ceiling for bleaching out the shading
+ int trans = 0, midtr = 239;
+ if (perLineScore)
+ {
+ trans = (int) ((1f - range) * midtr);
+ range = (float) ((annotation.score - plmin) / (plmax - aamin));
+ }
+ int dr = (int) (rr * range + r1), dg = (int) (gg * range + g1), db = (int) (bb
+ * range + b1);
+ if (annotation.score == annotation.score && positionToTransparency)
+ {
+ return new Color(Math.min(dr + trans, midtr), Math.min(dg
+ + trans, midtr), Math.min(db + trans, midtr));
+ }
+ else
+ {
+ return new Color(dr, dg, db);
+ }
}
public boolean isPredefinedColours()
completeStatus(rj, response);
break;
case 500:
- // Failed.
- rj.setSubmitted(true);
- rj.setAllowedServerExceptions(0);
- rj.setSubjobComplete(true);
- rj.error = true;
- rj.running = false;
- completeStatus(rj, response,
- "" + getStage(stg) + "failed. Reason below:\n");
+ markAsFailed(rj, response);
+ completeStatus(rj, response, "" + getStage(stg)
+ + "failed. Reason below:\n");
-
break;
default:
// Some other response. Probably need to pop up the content in a window.