From c08042015ee7edf7edf0f7790d07ce141aed6892 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 11 Oct 2013 10:58:00 +0100 Subject: [PATCH] JAL-1164 only predict on currently selected sequences for perSequence --- src/jalview/ws/jws2/JabawsAlignCalcWorker.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java index 720e76a..d6a8d18 100644 --- a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java +++ b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java @@ -23,6 +23,7 @@ import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; +import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.Annotation; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; @@ -149,7 +150,7 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker return; } List seqs = getInputSequences(alignViewport - .getAlignment()); + .getAlignment(), bySequence ? alignViewport.getSelectionGroup() : null); if (seqs == null) { @@ -380,7 +381,7 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker int realw; - public List getInputSequences(AlignmentI alignment) + public List getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs) { if (alignment == null || alignment.getWidth() <= 0 || alignment.getSequences() == null @@ -390,6 +391,11 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker { return null; } + if (inputSeqs==null || inputSeqs.getWidth()<=0 || inputSeqs.getSequences()==null || inputSeqs.getSequences().size()<1) + { + inputSeqs = alignment; + } + List seqs = new ArrayList(); int minlen = 10; @@ -399,7 +405,7 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker seqNames = new HashMap(); } gapMap = new boolean[0]; - for (SequenceI sq : ((List) alignment.getSequences())) + for (SequenceI sq : (List) inputSeqs.getSequences()) { if (sq.getEnd() - sq.getStart() > minlen - 1) { -- 1.7.10.2