From: Jim Procter Date: Mon, 21 Aug 2017 18:57:44 +0000 (+0100) Subject: Merge branch 'develop' into trial_merge/JAL-1950 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fspike%2FJAL-1950_hmmer3client;p=jalview.git Merge branch 'develop' into trial_merge/JAL-1950 Conflicts: src/jalview/gui/RestServiceEditorPane.java src/jalview/schemes/AnnotationColourGradient.java src/jalview/ws/rest/RestClient.java src/jalview/ws/rest/RestJobThread.java Shmmr client definition refactored. AnnotationColourGradient includes 'fade to grey' P-value+E-value shading --- 9f70ff4b6d193b340031997634c9e3602486bc8e diff --cc src/jalview/schemes/AnnotationColourGradient.java index 9e1a944,c28ea5f..f646963 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@@ -187,18 -188,17 +200,19 @@@ public class AnnotationColourGradient e seqannot = new IdentityHashMap(); } // 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; @@@ -240,19 -222,11 +254,19 @@@ } } - 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() @@@ -433,24 -434,12 +474,25 @@@ 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() diff --cc src/jalview/ws/rest/RestJobThread.java index 4ba613a,acb7904..e397c79 --- a/src/jalview/ws/rest/RestJobThread.java +++ b/src/jalview/ws/rest/RestJobThread.java @@@ -293,10 -312,14 +293,9 @@@ public class RestJobThread extends AWST 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.