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