1 /* Copyright (c) 2011 Peter Troshin
\r
3 * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0
\r
5 * This library is free software; you can redistribute it and/or modify it under the terms of the
\r
6 * Apache License version 2 as published by the Apache Software Foundation
\r
8 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
\r
9 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache
\r
10 * License for more details.
\r
12 * A copy of the license is in apache_license.txt. It is also available here:
\r
13 * @see: http://www.apache.org/licenses/LICENSE-2.0.txt
\r
15 * Any republication or derived work distributed in source code form
\r
16 * must include this copyright and license notice.
\r
18 package compbio.data.sequence;
\r
21 * Enumeration defining two constraints for SMERFS columns score calculation.
\r
22 * MAX_SCORE gives the highest core of all the windows the column belongs to.
\r
23 * MID_SCORE gives the window score to the column in the middle.
\r
25 * @author Agnieszka Golicz & Peter Troshin
\r
27 public enum SMERFSConstraints {
\r
29 MAX_SCORE, MID_SCORE;
\r
32 * Default column scoring schema
\r
34 public static final SMERFSConstraints DEFAULT_COLUMN_SCORE = SMERFSConstraints.MID_SCORE;
\r
37 * Default window size value for SMERFS algorithm
\r
39 public static final int DEFAULT_WINDOW_SIZE = 7;
\r
42 * Default gap threshold value for SMERFS algorithm
\r
44 public static final double DEFAULT_GAP_THRESHOLD = 0.1;
\r
46 public static SMERFSConstraints getSMERFSColumnScore(String score) {
\r
48 score = score.trim().toLowerCase();
\r
49 if (score.equalsIgnoreCase(SMERFSConstraints.MAX_SCORE.toString())) {
\r
50 return SMERFSConstraints.MAX_SCORE;
\r
52 if (score.equalsIgnoreCase(SMERFSConstraints.MID_SCORE.toString())) {
\r
53 return SMERFSConstraints.MID_SCORE;
\r