Package bgu.bio.algorithms.alignment

Examples of bgu.bio.algorithms.alignment.EditDistance


        return result.toString();
      } else if (command.equals("script.ed")) {
        String str1 = obj.optString("string1").toUpperCase();
        String str2 = obj.optString("string2").toUpperCase();
        EditDistance ed = new EditDistance(str1, str2,
            new IdentityEditDistanceScoringMatrix());
        if (str1 == null || str2 == null)
          return error("got no strings");

        ed.buildMatrix();
        int score = (int) ed.getAlignmentScore();
        String[] res = ed.printAlignments();

        result.put("command", "OK");
        result.put("score", score);
        result.put("line1", res[0]);
        result.put("middle", res[1]);
View Full Code Here


      response.setResponse("No Strings are given");
      return response;
    }
    string1 = string1 == null ? "" : string1;
    string2 = string2 == null ? "" : string2;
    EditDistance ed = new EditDistance(string1, string2,
        new IdentityEditDistanceScoringMatrix());

    int score = (int) ed.getAlignmentScore();
    String[] res = ed.printAlignments();
    response.setResponse(Arrays.toString(res));
    return response;
  }
View Full Code Here

TOP

Related Classes of bgu.bio.algorithms.alignment.EditDistance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.