JAL-1164 scope bySequence analysis methods to start/end of selected region or alignme...
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 11 Oct 2013 10:45:26 +0000 (11:45 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Fri, 11 Oct 2013 10:45:26 +0000 (11:45 +0100)
src/jalview/ws/jws2/AADisorderClient.java
src/jalview/ws/jws2/JabawsAlignCalcWorker.java

index 3c19dc5..96635c9 100644 (file)
@@ -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)
         {
index d6a8d18..926256d 100644 (file)
@@ -380,6 +380,8 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker
   boolean[] gapMap;
 
   int realw;
+  
+  int start,end;
 
   public List<FastaSequence> getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs)
   {
@@ -405,9 +407,12 @@ public abstract class JabawsAlignCalcWorker extends AlignCalcWorker
       seqNames = new HashMap<String, SequenceI>();
     }
     gapMap = new boolean[0];
+    start=inputSeqs.getStartRes();
+    end=inputSeqs.getEndRes();
+    
     for (SequenceI sq : (List<SequenceI>) 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)
         {