import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
import jalview.gui.AlignFrame;
+import jalview.gui.AlignmentPanel;
+import jalview.ws.jws2.dm.AAConsSettings;
import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.WsParamSetI;
WsParamSetI preset, List<Argument> paramset)
{
super(service, alignFrame, preset, paramset);
- submitGaps=true;
- alignedSeqs=true;
- nucleotidesAllowed=false;
- proteinAllowed=true;
+ submitGaps = true;
+ alignedSeqs = true;
+ nucleotidesAllowed = false;
+ proteinAllowed = true;
+ gapMap=new boolean[0];
+ initViewportParams();
}
+ protected void initViewportParams()
+ {
+ ((jalview.gui.AlignViewport) alignViewport).setCalcIdSettingsFor(getCalcId(), new AAConsSettings(true, service, this.preset, (arguments!=null) ? JabaParamStore.getJwsArgsfromJaba(arguments) : null), true);
+ }
+ @Override
+ public void updateParameters(WsParamSetI newpreset, java.util.List<Argument> newarguments) {
+ super.updateParameters(newpreset, newarguments);
+ initViewportParams();
+ };
public String getServiceActionText()
{
return "calculating Amino acid consensus using AACons service";
public void updateResultAnnotation(boolean immediate)
{
-
if (immediate || !calcMan.isWorking(this) && scoremanager != null)
{
AlignmentAnnotation annotation;
- ;
Map<String, TreeSet<Score>> scoremap = scoremanager.asMap();
int alWidth = alignViewport.getAlignment().getWidth();
AlignmentI alignment;
else
{
// simple annotation row
- annotation = findOrCreate(scr.getMethod(), true, null, null);
+ annotation = alignViewport.getAlignment()
+ .findOrCreateAnnotation(scr.getMethod(), getCalcId(), true,
+ null, null);
+
Annotation[] elm = new Annotation[alWidth];
- if (alWidth == scr.getScores().size())
+ if (alWidth == gapMap.length) // scr.getScores().size())
{
Iterator<Float> vals = scr.getScores().iterator();
float m = 0f, x = 0f;
x = val;
}
}
+ // if we're at a gapped column then skip to next ungapped position
+ if (gapMap != null && gapMap.length > 0)
+ {
+ while (!gapMap[i])
+ {
+ elm[i++]=new Annotation("", "" , ' ', Float.NaN);
+ }
+ }
elm[i] = new Annotation("", "" + val, ' ', val);
}
}
}
+ public String getCalcId()
+ {
+ return SequenceAnnotationWSClient.AAConsCalcId;
+ }
+
+ public static void removeAAConsAnnotation(AlignmentPanel alignPanel)
+ {
+ for (AlignmentAnnotation aa: alignPanel.getAlignment().findAnnotation(SequenceAnnotationWSClient.AAConsCalcId))
+ {
+ alignPanel.getAlignment().deleteAnnotation(aa);
+ }
+ // List<AlignmentAnnotation>
+ // ourannots=alignPanel.getAlignment().findAnnotation(Screen3D.)
+ // TODO Auto-generated method stub
+
+ }
}