From f23b980dfbe309bdeb10514dad28c357b06768a4 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 23 Sep 2019 11:30:06 +0100 Subject: [PATCH] =?utf8?q?JAL-3070=20configure=20annotation=20service=20mana?= =?utf8?q?ger=20from=20service=E2=80=99s=20input=20validation=20flags?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../ws/jws2/SeqAnnotationServiceCalcWorker.java | 30 +++++-------------- src/jalview/ws/jws2/jabaws2/Jws2Instance.java | 31 ++++++++++++++++++++ 2 files changed, 39 insertions(+), 22 deletions(-) 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; + } } -- 1.7.10.2