From 51f4e1c750d0de8937e69788f7b14c6120fd310f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 11 Oct 2013 11:45:26 +0100 Subject: [PATCH] JAL-1164 scope bySequence analysis methods to start/end of selected region or alignment region. --- src/jalview/ws/jws2/AADisorderClient.java | 2 +- src/jalview/ws/jws2/JabawsAlignCalcWorker.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/jalview/ws/jws2/AADisorderClient.java b/src/jalview/ws/jws2/AADisorderClient.java index 3c19dc5..96635c9 100644 --- a/src/jalview/ws/jws2/AADisorderClient.java +++ b/src/jalview/ws/jws2/AADisorderClient.java @@ -181,7 +181,7 @@ public class AADisorderClient extends JabawsAlignCalcWorker implements { boolean sameGroup = false; SequenceI dseq, aseq, seq = seqNames.get(seqId); - int base = seq.getStart() - 1; + int base = seq.findPosition(start)-1; aseq = seq; while ((dseq = seq).getDatasetSequence() != null) { diff --git a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java index d6a8d18..926256d 100644 --- a/src/jalview/ws/jws2/JabawsAlignCalcWorker.java +++ b/src/jalview/ws/jws2/JabawsAlignCalcWorker.java @@ -380,6 +380,8 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker boolean[] gapMap; int realw; + + int start,end; public List getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs) { @@ -405,9 +407,12 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker seqNames = new HashMap(); } gapMap = new boolean[0]; + start=inputSeqs.getStartRes(); + end=inputSeqs.getEndRes(); + for (SequenceI sq : (List) inputSeqs.getSequences()) { - if (sq.getEnd() - sq.getStart() > minlen - 1) + if (sq.findPosition(end+1) -sq.findPosition(start+1) > minlen - 1) { String newname = SeqsetUtils.unique_name(seqs.size() + 1); // make new input sequence with or without gaps @@ -439,7 +444,7 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker { seqs.add(seq = new compbio.data.sequence.FastaSequence(newname, AlignSeq.extractGaps(jalview.util.Comparison.GapChars, - sq.getSequenceAsString()))); + sq.getSequenceAsString(start,end+1)))); } if (seq.getSequence().length() > ln) { -- 1.7.10.2