public abstract class JabawsAlignCalcWorker extends AlignCalcWorker
{
Jws2Instance service;
+
@SuppressWarnings("unchecked")
protected SequenceAnnotation aaservice;
* reconfigure and restart the AAConsClient. This method will spawn a new
* thread that will wait until any current jobs are finished, modify the
* parameters and restart the conservation calculation with the new values.
- *
+ *
* @param newpreset
* @param newarguments
*/
int serverErrorsLeft = 3;
String rslt = "JOB NOT DEFINED";
- StringBuffer msg=new StringBuffer();
+ StringBuffer msg = new StringBuffer();
try
{
if (checkDone())
guiProgress.setProgressBar("JABA " + getServiceActionText(),
progressId = System.currentTimeMillis());
}
- if (preset == null && arguments==null)
+ if (preset == null && arguments == null)
{
rslt = aaservice.analize(seqs);
}
if (ap != null)
{
calcMan.workerComplete(this);
- if (guiProgress != null && progressId!=-1)
+ if (guiProgress != null && progressId != -1)
{
guiProgress.setProgressBar("", progressId);
}
ap.paintAlignment(true);
}
- if (msg.length()>0)
+ if (msg.length() > 0)
{
// TODO: stash message somewhere in annotation or alignment view.
// code below shows result in a text box popup
- /* jalview.gui.CutAndPasteTransfer cap = new jalview.gui.CutAndPasteTransfer();
- cap.setText(msg.toString());
- jalview.gui.Desktop.addInternalFrame(cap, "Job Status for "+getServiceActionText(), 600, 400); */
+ /*
+ * jalview.gui.CutAndPasteTransfer cap = new
+ * jalview.gui.CutAndPasteTransfer(); cap.setText(msg.toString());
+ * jalview.gui.Desktop.addInternalFrame(cap,
+ * "Job Status for "+getServiceActionText(), 600, 400);
+ */
}
}
protected boolean bySequence = false;
Map<String, SequenceI> seqNames;
+
boolean[] gapMap;
+
int realw;
+
public List<FastaSequence> getInputSequences(AlignmentI alignment)
{
if (alignment == null || alignment.getWidth() <= 0
{
seqNames = new HashMap<String, SequenceI>();
}
- gapMap=new boolean[0];
+ gapMap = new boolean[0];
for (SequenceI sq : ((List<SequenceI>) alignment.getSequences()))
{
if (sq.getEnd() - sq.getStart() > minlen - 1)
FastaSequence seq;
if (submitGaps)
{
- seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,sq.getSequenceAsString()));
- if (gapMap==null || gapMap.length<seq.getSequence().length())
+ seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
+ sq.getSequenceAsString()));
+ if (gapMap == null || gapMap.length < seq.getSequence().length())
{
- boolean[] tg=gapMap;
- gapMap=new boolean[seq.getLength()];
+ boolean[] tg = gapMap;
+ gapMap = new boolean[seq.getLength()];
System.arraycopy(tg, 0, gapMap, 0, tg.length);
- for (int p=tg.length;p<gapMap.length;p++)
+ for (int p = tg.length; p < gapMap.length; p++)
{
- gapMap[p]=false; // init as a gap
+ gapMap[p] = false; // init as a gap
}
}
- for (int apos:sq.gapMap()) {
- gapMap[apos]=true; // aligned.
+ for (int apos : sq.gapMap())
+ {
+ gapMap[apos] = true; // aligned.
}
- } else {
- seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
- AlignSeq
- .extractGaps(jalview.util.Comparison.GapChars,
- sq.getSequenceAsString())));
+ }
+ else
+ {
+ seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
+ AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
+ sq.getSequenceAsString())));
}
if (seq.getSequence().length() > ln)
{
if (alignedSeqs && submitGaps)
{
realw = 0;
- for (int i=0;i<gapMap.length;i++)
+ for (int i = 0; i < gapMap.length; i++)
{
if (gapMap[i])
{
FastaSequence sq = seqs.get(p);
int l = sq.getSequence().length();
// strip gapped columns
- char[] padded = new char[realw],orig=sq.getSequence().toCharArray();
- for (int i=0,pp=0;i<realw; pp++)
+ char[] padded = new char[realw], orig = sq.getSequence()
+ .toCharArray();
+ for (int i = 0, pp = 0; i < realw; pp++)
{
if (gapMap[pp])
{
- if (orig.length>pp)
+ if (orig.length > pp)
{
- padded[i++]=orig[pp];
- } else {
- padded[i++]='-';
- }
+ padded[i++] = orig[pp];
+ }
+ else
+ {
+ padded[i++] = '-';
+ }
}
}
seqs.set(p, new compbio.data.sequence.FastaSequence(sq.getId(),
- new String(padded)));
+ new String(padded)));
}
}
return seqs;
/**
* notify manager that we have started, and wait for a free calculation slot
- *
+ *
* @return true if slot is obtained and work still valid, false if another
* thread has done our work for us.
*/