From: Jim Procter Date: Fri, 11 Oct 2013 09:58:00 +0000 (+0100) Subject: JAL-1164 only predict on currently selected sequences for perSequence X-Git-Tag: Release_2_8_0b1~1^2~44^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c08042015ee7edf7edf0f7790d07ce141aed6892;p=jalview.git JAL-1164 only predict on currently selected sequences for perSequence --- 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) {