{
protected Jws2Instance service;
+
@SuppressWarnings("unchecked")
protected SequenceAnnotation aaservice;
+
protected ScoreManager scoremanager;
+
protected WsParamSetI preset;
+
protected List<Argument> arguments;
+
protected IProgressIndicator guiProgress;
public JabawsCalcWorker(AlignViewportI alignViewport,
* @param newpreset
* @param newarguments
*/
- public void updateParameters(final WsParamSetI newpreset, final List<Argument> newarguments)
+ public void updateParameters(final WsParamSetI newpreset,
+ final List<Argument> newarguments)
{
preset = newpreset;
arguments = newarguments;
return;
}
long progressId = -1;
-
+
int serverErrorsLeft = 3;
-
+
String rslt = "JOB NOT DEFINED";
StringBuffer msg = new StringBuffer();
try
{
return;
}
- List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(alignViewport
- .getAlignment(), bySequence ? alignViewport.getSelectionGroup() : null);
-
+ List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(
+ alignViewport.getAlignment(),
+ bySequence ? alignViewport.getSelectionGroup() : null);
+
if (seqs == null)
{
calcMan.workerComplete(this);
return;
}
-
+
AlignmentAnnotation[] aa = alignViewport.getAlignment()
.getAlignmentAnnotation();
if (guiProgress != null)
{
throw new JobSubmissionException(
"Invalid parameter set. Check Jalview implementation.", x);
-
+
}
}
boolean finished = false;
{
System.err.println("FAILED TO CANCEL AACon job: " + rslt);
}
-
+
} catch (Exception x)
{
-
+
}
-
+
return;
}
long cpos;
stats = aaservice.pullExecStatistics(rslt, rpos);
} catch (Exception x)
{
-
+
if (x.getMessage().contains(
"Position in a file could not be negative!"))
{
rpos = stats.getNextPosition();
}
} while (stats != null && rpos > cpos);
-
+
if (!finished && status.equals(JobStatus.FAILED))
{
try
}
}
}
-
+
catch (JobSubmissionException x)
{
-
+
System.err.println("submission error with " + getServiceActionText()
+ " :");
x.printStackTrace();
System.err.println("collection error:\nJob ID: " + rslt);
x.printStackTrace();
calcMan.workerCannotRun(this);
-
+
} catch (OutOfMemoryError error)
{
calcMan.workerCannotRun(this);
-
+
// consensus = null;
// hconsensus = null;
ap.raiseOOMWarning(getServiceActionText(), error);
} catch (Exception x)
{
calcMan.workerCannotRun(this);
-
+
// consensus = null;
// hconsensus = null;
System.err
x.printStackTrace();
} finally
{
-
+
calcMan.workerComplete(this);
if (ap != null)
{
*/
}
}
-
+
}
@Override
public abstract String getServiceActionText();
protected boolean submitGaps = true;
+
protected boolean alignedSeqs = true;
+
protected boolean nucleotidesAllowed = false;
+
protected boolean proteinAllowed = false;
+
/**
* record sequences for mapping result back to afterwards
*/
protected boolean bySequence = false;
+
protected Map<String, SequenceI> seqNames;
+
protected boolean[] gapMap;
+
int realw;
- int start,end;
- public List<FastaSequence> getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs)
+ int start, end;
+
+ public List<FastaSequence> getInputSequences(AlignmentI alignment,
+ AnnotatedCollectionI inputSeqs)
{
if (alignment == null || alignment.getWidth() <= 0
- || alignment.getSequences() == null
- || alignment.isNucleotide() ? !nucleotidesAllowed
+ || alignment.getSequences() == null || alignment.isNucleotide() ? !nucleotidesAllowed
: !proteinAllowed)
{
return null;
}
- if (inputSeqs==null || inputSeqs.getWidth()<=0 || inputSeqs.getSequences()==null || inputSeqs.getSequences().size()<1)
+ if (inputSeqs == null || inputSeqs.getWidth() <= 0
+ || inputSeqs.getSequences() == null
+ || inputSeqs.getSequences().size() < 1)
{
inputSeqs = alignment;
}
-
+
List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
int minlen = 10;
seqNames = new HashMap<String, SequenceI>();
}
gapMap = new boolean[0];
- start=inputSeqs.getStartRes();
- end=inputSeqs.getEndRes();
-
+ start = inputSeqs.getStartRes();
+ end = inputSeqs.getEndRes();
for (SequenceI sq : ((List<SequenceI>) inputSeqs.getSequences()))
{
- if (bySequence ? sq.findPosition(end+1) -sq.findPosition(start+1) > minlen - 1 : sq.getEnd() - sq.getStart() > minlen - 1)
+ if (bySequence ? sq.findPosition(end + 1)
+ - sq.findPosition(start + 1) > minlen - 1 : sq.getEnd()
+ - sq.getStart() > minlen - 1)
{
String newname = SeqsetUtils.unique_name(seqs.size() + 1);
// make new input sequence with or without gaps
{
seqs.add(seq = new compbio.data.sequence.FastaSequence(newname,
AlignSeq.extractGaps(jalview.util.Comparison.GapChars,
- sq.getSequenceAsString(start,end+1))));
+ sq.getSequenceAsString(start, end + 1))));
}
if (seq.getSequence().length() > ln)
{
{
ap.paintAlignment(false);
}
-
+
Thread.sleep(200);
} catch (Exception ex)
{
return false;
}
- protected void createAnnotationRowsForScores(List<AlignmentAnnotation> ourAnnot, String calcId,
- int alWidth, Score scr)
+ protected void createAnnotationRowsForScores(
+ List<AlignmentAnnotation> ourAnnot, String calcId, int alWidth,
+ Score scr)
{
// simple annotation row
AlignmentAnnotation annotation = alignViewport.getAlignment()
}
}
- protected AlignmentAnnotation createAnnotationRowsForScores(List<AlignmentAnnotation> ourAnnot, String typeName,
+ protected AlignmentAnnotation createAnnotationRowsForScores(
+ List<AlignmentAnnotation> ourAnnot, String typeName,
String calcId, SequenceI dseq, int base, Score scr)
{
System.out.println("Creating annotation on dseq:" + dseq.getStart()
return annotation;
}
- private void constructAnnotationFromScore(AlignmentAnnotation annotation, int base,
- int alWidth, Score scr)
+ private void constructAnnotationFromScore(AlignmentAnnotation annotation,
+ int base, int alWidth, Score scr)
{
Annotation[] elm = new Annotation[alWidth];
Iterator<Float> vals = scr.getScores().iterator();
}
elm[i] = new Annotation("", "" + val, ' ', val);
}
-
+
annotation.annotations = elm;
annotation.belowAlignment = true;
if (x < 0)
}
}
our.clear();
-
+
ap.adjustAnnotationHeight();
}
}