From: Jim Procter Date: Mon, 23 Sep 2019 10:30:06 +0000 (+0100) Subject: JAL-3070 configure annotation service manager from service’s input validation flags X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f23b980dfbe309bdeb10514dad28c357b06768a4;p=jalview.git JAL-3070 configure annotation service manager from service’s input validation flags --- diff --git a/src/jalview/ws/jws2/SeqAnnotationServiceCalcWorker.java b/src/jalview/ws/jws2/SeqAnnotationServiceCalcWorker.java index 6793f1e..e92a338 100644 --- a/src/jalview/ws/jws2/SeqAnnotationServiceCalcWorker.java +++ b/src/jalview/ws/jws2/SeqAnnotationServiceCalcWorker.java @@ -183,31 +183,17 @@ public class SeqAnnotationServiceCalcWorker extends AlignCalcWorker } // configure submission flags - if (service.getAlignAnalysisUI() != null) + proteinAllowed = service.isProteinService(); + nucleotidesAllowed = service.isNucleotideService(); + alignedSeqs = service.isNeedsAlignedSequences(); + bySequence = !service.isAlignmentAnalysis(); + filterNonStandardResidues = service.isFilterSymbols(); + min_valid_seqs = service.getMinimumInputSequences(); + + if (service.isInteractiveUpdate()) { - // instantaneous calculation. Right now that's either AACons or RNAAliFold - proteinAllowed = service.getAlignAnalysisUI().isPr(); - nucleotidesAllowed = service.getAlignAnalysisUI().isNa(); - alignedSeqs = service.getAlignAnalysisUI().isNeedsAlignedSeqs(); - bySequence = !service.getAlignAnalysisUI().isAA(); - filterNonStandardResidues = service.getAlignAnalysisUI() - .isFilterSymbols(); - min_valid_seqs = service.getAlignAnalysisUI().getMinimumSequences(); initViewportParams(); } - else - { - // assume disorder prediction : per-sequence protein only no gaps - // analysis. - // TODO - move configuration to UIInfo base class for all these flags ! - alignedSeqs = false; - bySequence = true; - filterNonStandardResidues = true; - nucleotidesAllowed = false; - proteinAllowed = true; - submitGaps = false; - min_valid_seqs = 1; - } } /** diff --git a/src/jalview/ws/jws2/jabaws2/Jws2Instance.java b/src/jalview/ws/jws2/jabaws2/Jws2Instance.java index 29f1ed1..194b315 100644 --- a/src/jalview/ws/jws2/jabaws2/Jws2Instance.java +++ b/src/jalview/ws/jws2/jabaws2/Jws2Instance.java @@ -305,4 +305,35 @@ public class Jws2Instance extends ServiceWithParameters { return aaui != null && aaui.isAA(); } + // config flags for SeqAnnotationServiceCalcWorker + + public boolean isProteinService() + { + return aaui == null ? true : aaui.isPr(); + } + + public boolean isNucleotideService() + { + return aaui == null ? false : aaui.isNa(); + } + + public boolean isNeedsAlignedSequences() + { + return aaui == null ? false : aaui.isNeedsAlignedSeqs(); + } + + public boolean isAlignmentAnalysis() + { + return aaui == null ? false : aaui.isAA(); + } + + public boolean isFilterSymbols() + { + return aaui != null ? aaui.isFilterSymbols() : true; + } + + public int getMinimumInputSequences() + { + return aaui != null ? aaui.getMinimumSequences() : 1; + } }