X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FAADisorderClient.java;h=fb6ffc412e5400057362cdf841366776ced174d6;hb=3d0101179759ef157b088ea135423cd909512d9f;hp=d955db544b2edd037a158ea084eebd518a195657;hpb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;p=jalview.git diff --git a/src/jalview/ws/jws2/AADisorderClient.java b/src/jalview/ws/jws2/AADisorderClient.java index d955db5..fb6ffc4 100644 --- a/src/jalview/ws/jws2/AADisorderClient.java +++ b/src/jalview/ws/jws2/AADisorderClient.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) - * Copyright (C) 2015 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -21,14 +21,15 @@ package jalview.ws.jws2; import jalview.api.AlignCalcWorkerI; +import jalview.api.FeatureColourI; import jalview.bin.Cache; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.GraphLine; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; -import jalview.schemes.GraduatedColor; -import jalview.schemes.UserColourScheme; +import jalview.schemes.FeatureColour; +import jalview.util.ColorUtils; import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.WsParamSetI; @@ -46,8 +47,7 @@ import compbio.data.sequence.Score; import compbio.data.sequence.ScoreManager.ScoreHolder; import compbio.metadata.Argument; -public class AADisorderClient extends JabawsCalcWorker implements - AlignCalcWorkerI +public class AADisorderClient extends JabawsCalcWorker { private static final String THRESHOLD = "THRESHOLD"; @@ -104,8 +104,9 @@ public class AADisorderClient extends JabawsCalcWorker implements Map fmap; featureMap.put(compbio.ws.client.Services.IUPredWS.toString(), fmap = new HashMap()); - fmap.put("Glob", new String[] { "Globular Domain", - "Predicted globular domain" }); + fmap.put("Glob", + new String[] + { "Globular Domain", "Predicted globular domain" }); featureMap.put(compbio.ws.client.Services.JronnWS.toString(), fmap = new HashMap()); featureMap.put(compbio.ws.client.Services.DisemblWS.toString(), @@ -115,10 +116,12 @@ public class AADisorderClient extends JabawsCalcWorker implements fmap.put("COILS", new String[] { "COILS", "Random coil" }); featureMap.put(compbio.ws.client.Services.GlobPlotWS.toString(), fmap = new HashMap()); - fmap.put("GlobDoms", new String[] { "Globular Domain", - "Predicted globular domain" }); - fmap.put("Disorder", new String[] { "Protein Disorder", - "Probable unstructured peptide region" }); + fmap.put("GlobDoms", + new String[] + { "Globular Domain", "Predicted globular domain" }); + fmap.put("Disorder", + new String[] + { "Protein Disorder", "Probable unstructured peptide region" }); Map> amap; annotMap = new HashMap>>(); annotMap.put(compbio.ws.client.Services.GlobPlotWS.toString(), @@ -207,9 +210,7 @@ public class AADisorderClient extends JabawsCalcWorker implements { Cache.log .info("Couldn't recover disorder prediction for sequence " - + seq.getName() - + "(Prediction name was " - + seqId + + seq.getName() + "(Prediction name was " + seqId + ")" + "\nSee http://issues.jalview.org/browse/JAL-1319 for one possible reason why disorder predictions might fail."); } @@ -238,14 +239,14 @@ public class AADisorderClient extends JabawsCalcWorker implements } if (vals.hasNext()) { - sf = new SequenceFeature(type[0], type[1], - base + rn.from, base + rn.to, val = vals.next() - .floatValue(), methodName); + sf = new SequenceFeature(type[0], type[1], base + rn.from, + base + rn.to, val = vals.next().floatValue(), + methodName); } else { - sf = new SequenceFeature(type[0], type[1], null, base - + rn.from, base + rn.to, methodName); + sf = new SequenceFeature(type[0], type[1], null, + base + rn.from, base + rn.to, methodName); } dseq.addSequenceFeature(sf); if (last != val && !Float.isNaN(last)) @@ -268,13 +269,15 @@ public class AADisorderClient extends JabawsCalcWorker implements typename = service.serviceType + " (" + scr.getMethod() + ")", calcName = service.getServiceTypeURI() + "/" - + scr.getMethod(), aseq, base + 1, scr); + + scr.getMethod(), + aseq, base + 1, scr); annot.graph = AlignmentAnnotation.LINE_GRAPH; Map styleMap = (annotTypeMap == null) ? null : annotTypeMap.get(scr.getMethod()); - annot.visible = (styleMap == null || styleMap.get(INVISIBLE) == null); + annot.visible = (styleMap == null + || styleMap.get(INVISIBLE) == null); double[] thrsh = (styleMap == null) ? null : (double[]) styleMap.get(THRESHOLD); float[] range = (styleMap == null) ? null @@ -308,7 +311,7 @@ public class AADisorderClient extends JabawsCalcWorker implements annot.description += "
" + threshNote; } annot.description += ""; - Color col = new UserColourScheme(typeName) + Color col = ColorUtils .createColourFromName(typeName + scr.getMethod()); for (int p = 0, ps = annot.annotations.length; p < ps; p++) { @@ -337,13 +340,13 @@ public class AADisorderClient extends JabawsCalcWorker implements .cloneFeatureRenderer(); for (String ft : fc.keySet()) { - Object gc = fr.getFeatureStyle(ft); - if (gc instanceof Color) + FeatureColourI gc = fr.getFeatureStyle(ft); + if (gc.isSimpleColour()) { // set graduated color as fading to white for minimum, and // autoscaling to values on alignment - GraduatedColor ggc = new GraduatedColor(Color.white, - (Color) gc, Float.MIN_VALUE, Float.MAX_VALUE); + FeatureColourI ggc = new FeatureColour(Color.white, + gc.getColour(), Float.MIN_VALUE, Float.MAX_VALUE); ggc.setAutoScaled(true); fr.setColour(ft, ggc); }