import jalview.api.FeatureColourI;
import jalview.api.PollableAlignCalcWorkerI;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AnnotatedCollectionI;
} catch (ClassCastException cce)
{
annotService = null;
- JvOptionPane.showMessageDialog(Desktop.desktop,
+ JvOptionPane.showMessageDialog(Desktop.getInstance(),
MessageManager.formatMessage(
"label.service_called_is_not_an_annotation_service",
new String[]
if (seqs == null || !checkValidInputSeqs(seqs))
{
- jalview.bin.Cache.log.debug(
+ jalview.bin.Console.debug(
"Sequences for analysis service were null or not valid");
return;
}
guiProgress.setProgressBar(service.getActionText(),
progressId = System.currentTimeMillis());
}
- jalview.bin.Cache.log.debug("submitted " + seqs.size()
+ jalview.bin.Console.debug("submitted " + seqs.size()
+ " sequences to " + service.getActionText());
rslt = annotService.submitToService(seqs, getPreset(),
return;
}
// TODO: handle job submission error reporting here.
- Cache.log.debug("Service " + service.getUri() + "\nSubmitted job ID: "
+ Console.debug("Service " + service.getUri() + "\nSubmitted job ID: "
+ rslt);
- ;
// ///
// otherwise, construct WsJob and any UI handlers
running = new AnnotationWsJob();
{
boolean finished = false;
- Cache.log.debug("Updating status for annotation service.");
+ Console.debug("Updating status for annotation service.");
annotService.updateStatus(running);
job.updateJobPanelState(info, "", running);
if (running.isSubjobComplete())
{
- Cache.log.debug(
+ Console.debug(
"Finished polling analysis service job: status reported is "
+ running.getState());
finished = true;
}
else
{
- Cache.log.debug("Status now " + running.getState());
+ Console.debug("Status now " + running.getState());
}
// pull any stats - some services need to flush log output before
// results are available
- Cache.log.debug("Updating progress log for annotation service.");
+ Console.debug("Updating progress log for annotation service.");
try
{
annotService.updateJobProgress(running);
} catch (Throwable thr)
{
- Cache.log.debug("Ignoring exception during progress update.",
+ Console.debug("Ignoring exception during progress update.",
thr);
}
- Cache.log.trace("Result of poll: " + running.getStatus());
+ Console.debug("Result of poll: " + running.getStatus());
if (finished)
{
- Cache.log.debug("Job poll loop exited. Job is " + running.getState());
+ Console.debug("Job poll loop exited. Job is " + running.getState());
if (running.isFinished())
{
// expect there to be results to collect
// features automatically according to user preferences
running.setFeatureRenderer(
((jalview.gui.AlignmentPanel) ap).cloneFeatureRenderer());
- Cache.log.debug("retrieving job results.");
+ Console.debug("retrieving job results.");
final Map<String, FeatureColourI> featureColours = new HashMap<>();
final Map<String, FeatureMatcherSetI> featureFilters = new HashMap<>();
List<AlignmentAnnotation> returnedAnnot = annotService
.getAnnotationResult(running.getJobHandle(), seqs,
featureColours, featureFilters);
- Cache.log.debug("Obtained " + (returnedAnnot == null ? "no rows"
+ Console.debug("Obtained " + (returnedAnnot == null ? "no rows"
: ("" + returnedAnnot.size())));
- Cache.log.debug("There were " + featureColours.size()
+ Console.debug("There were " + featureColours.size()
+ " feature colours and " + featureFilters.size()
+ " filters defined.");
if (running.hasResults())
{
- jalview.bin.Cache.log.debug("Updating result annotation from Job "
+ jalview.bin.Console.debug("Updating result annotation from Job "
+ rslt + " at " + service.getUri());
updateResultAnnotation(true);
if (running.isTransferSequenceFeatures())
// regions
// not annotated due to gapMap/column visibility
- jalview.bin.Cache.log.debug(
+ jalview.bin.Console.debug(
"Updating feature display settings and transferring features from Job "
+ rslt + " at " + service.getUri());
// TODO: consider merge rather than apply here
ap.adjustAnnotationHeight();
}
}
- Cache.log.debug("Annotation Service Worker thread finished.");
+ Console.debug("Annotation Service Worker thread finished.");
}
{
ala.graphGroup += graphGroup;
}
- SequenceI aseq = null;
-
- /**
+ SequenceI aseq = (ala.sequenceRef == null) ? null
+ : running.getSeqNames().get(ala.sequenceRef.getName());
+ /*
* transfer sequence refs and adjust gapmap
+ * Prepare an array for annotations and copy returned annotations to it
+ * according to gapMap if present.
*/
- if (ala.sequenceRef != null)
- {
- SequenceI seq = running.getSeqNames()
- .get(ala.sequenceRef.getName());
- aseq = seq;
- while (seq.getDatasetSequence() != null)
- {
- seq = seq.getDatasetSequence();
- }
- }
Annotation[] resAnnot = ala.annotations,
gappedAnnot = new Annotation[Math.max(
alignViewport.getAlignment().getWidth(),
gapMap.length)];
- for (int p = 0, ap = start; ap < gappedAnnot.length; ap++)
+ for (int p = 0, ap = 0; ap < gappedAnnot.length; ap++)
{
if (gapMap != null && gapMap.length > ap && !gapMap[ap])
{
}
}
ala.sequenceRef = aseq;
- ala.annotations = gappedAnnot;
AlignmentAnnotation newAnnot = getAlignViewport().getAlignment()
.updateFromOrCopyAnnotation(ala);
+ newAnnot.annotations = gappedAnnot;
if (aseq != null)
{
-
+ newAnnot.createSequenceMapping(aseq, aseq.findPosition(start), false);
aseq.addAlignmentAnnotation(newAnnot);
newAnnot.adjustForAlignment();