Exemplo n.º 1
0
  @Override
  protected void processResults() throws ServiceException {
    String seqs[] = getOutputs().get("sequences").split(">");
    String seq1 = seqs[0].substring(seqs[0].indexOf('\n')).replace("\n", "").trim();
    String seq2 = seqs[1].substring(seqs[1].indexOf('\n')).replace("\n", "").trim();

    try {
      if (isAa()) {
        setAlignedSequence1(
            ProteinTools.createGappedProteinSequence(seq1, getSequence1().getName()));
        setAlignedSequence2(
            ProteinTools.createGappedProteinSequence(seq2, getSequence2().getName()));
      } else {
        setAlignedSequence1(DNATools.createGappedDNASequence(seq1, getSequence1().getName()));
        setAlignedSequence2(DNATools.createGappedDNASequence(seq2, getSequence2().getName()));
      }
    } catch (IllegalSymbolException e) {
      e.printStackTrace();
      throw new AlignServiceException(getService(), getUrl(), e);
    }

    setScore(Double.parseDouble(getOutputs().get("score")));
  }