92130f1bc2c46bd3930e1262407efee78aeb88d9
[jabaws.git] / datamodel / compbio / data / sequence / ConservationMethod.java
1 /*
2  * Copyright (c) 2010 Agnieszka Golicz & Peter Troshin 
3  * 
4  * Amino Acid Conservation @version: 1.0 
5  * 
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Apache License version 2 as published by the
8  * Apache Software Foundation This library is distributed in the hope that it
9  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
10  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache
11  * License for more details. A copy of the license is in apache_license.txt. It
12  * is also available here: http://www.apache.org/licenses/LICENSE-2.0.txt 
13  * Any republication or derived work distributed in source code form must 
14  * include this copyright and license notice.
15  * 
16  */
17 package compbio.data.sequence;
18
19 /**
20  * Enumeration listing of all the supported methods.
21  * 
22  * @author Agnieszka Golicz & Peter Troshin
23  */
24 public enum ConservationMethod {
25         KABAT, JORES, SCHNEIDER, SHENKIN, GERSTEIN, TAYLOR_GAPS, TAYLOR_NO_GAPS, ZVELIBIL, KARLIN, ARMON, THOMPSON, NOT_LANCET, MIRNY, WILLIAMSON, LANDGRAF, SANDER, VALDAR, SMERFS;
26
27         public static ConservationMethod getMethod(String meth) {
28                 meth = meth.trim().toLowerCase();
29                 if (meth.equalsIgnoreCase(KABAT.toString())) {
30                         return KABAT;
31                 }
32                 if (meth.equalsIgnoreCase(JORES.toString())) {
33                         return JORES;
34                 }
35                 if (meth.equalsIgnoreCase(SCHNEIDER.toString())) {
36                         return SCHNEIDER;
37                 }
38                 if (meth.equalsIgnoreCase(SHENKIN.toString())) {
39                         return SHENKIN;
40                 }
41                 if (meth.equalsIgnoreCase(GERSTEIN.toString())) {
42                         return GERSTEIN;
43                 }
44                 if (meth.equalsIgnoreCase(TAYLOR_GAPS.toString())) {
45                         return TAYLOR_GAPS;
46                 }
47                 if (meth.equalsIgnoreCase(TAYLOR_NO_GAPS.toString())) {
48                         return TAYLOR_NO_GAPS;
49                 }
50                 if (meth.equalsIgnoreCase(ZVELIBIL.toString())) {
51                         return ZVELIBIL;
52                 }
53                 if (meth.equalsIgnoreCase(KARLIN.toString())) {
54                         return KARLIN;
55                 }
56                 if (meth.equalsIgnoreCase(ARMON.toString())) {
57                         return ARMON;
58                 }
59                 if (meth.equalsIgnoreCase(THOMPSON.toString())) {
60                         return THOMPSON;
61                 }
62                 if (meth.equalsIgnoreCase(NOT_LANCET.toString())) {
63                         return NOT_LANCET;
64                 }
65                 if (meth.equalsIgnoreCase(MIRNY.toString())) {
66                         return MIRNY;
67                 }
68                 if (meth.equalsIgnoreCase(WILLIAMSON.toString())) {
69                         return WILLIAMSON;
70                 }
71                 if (meth.equalsIgnoreCase(LANDGRAF.toString())) {
72                         return LANDGRAF;
73                 }
74                 if (meth.equalsIgnoreCase(SANDER.toString())) {
75                         return SANDER;
76                 }
77                 if (meth.equalsIgnoreCase(VALDAR.toString())) {
78                         return VALDAR;
79                 }
80                 if (meth.equalsIgnoreCase(SMERFS.toString())) {
81                         return SMERFS;
82                 }
83                 return null;
84         }
85
86 }