+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Copyright (C) 2014 The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.ws.jws2;
import jalview.analysis.AlignSeq;
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;
return;
}
List<compbio.data.sequence.FastaSequence> seqs = getInputSequences(alignViewport
- .getAlignment());
+ .getAlignment(), bySequence ? alignViewport.getSelectionGroup() : null);
if (seqs == null)
{
} catch (WrongParameterException x)
{
throw new JobSubmissionException(
- "Invalid paremeter set. Check Jalview implementation.", x);
+ "Invalid parameter set. Check Jalview implementation.", x);
}
}
}
else
{
- System.err.println("FAILED TO CANCELL AACon job: " + rslt);
+ System.err.println("FAILED TO CANCEL AACon job: " + rslt);
}
} catch (Exception x)
try
{
stats = aaservice.pullExecStatistics(rslt, rpos);
- } catch (Exception x)
+ } catch (Exception x)
{
if (x.getMessage().contains(
if (--serverErrorsLeft > 0)
{
retry = true;
- try {
+ try
+ {
Thread.sleep(200);
- } catch (InterruptedException q) {};
- } else {
+ } catch (InterruptedException q)
+ {
+ }
+ ;
+ }
+ else
+ {
throw x;
}
}
;
}
} while (!finished);
- if (serverErrorsLeft>0)
+ if (serverErrorsLeft > 0)
{
try
{
boolean[] gapMap;
int realw;
+
+ int start,end;
- public List<FastaSequence> getInputSequences(AlignmentI alignment)
+ public List<FastaSequence> getInputSequences(AlignmentI alignment, AnnotatedCollectionI inputSeqs)
{
if (alignment == null || alignment.getWidth() <= 0
|| alignment.getSequences() == null
{
return null;
}
+ if (inputSeqs==null || inputSeqs.getWidth()<=0 || inputSeqs.getSequences()==null || inputSeqs.getSequences().size()<1)
+ {
+ inputSeqs = alignment;
+ }
+
List<compbio.data.sequence.FastaSequence> seqs = new ArrayList<compbio.data.sequence.FastaSequence>();
int minlen = 10;
seqNames = new HashMap<String, SequenceI>();
}
gapMap = new boolean[0];
- for (SequenceI sq : ((List<SequenceI>) alignment.getSequences()))
+ 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
{
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)
{