apply gpl development license
[jalview.git] / src / jalview / ws / dbsources / GeneDbSource.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)\r
3  * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  * \r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License\r
7  * as published by the Free Software Foundation; either version 2\r
8  * of the License, or (at your option) any later version.\r
9  * \r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  * \r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18  */\r
19 package jalview.ws.dbsources;\r
20 \r
21 import java.io.File;\r
22 import java.util.Hashtable;\r
23 import java.util.Iterator;\r
24 import java.util.StringTokenizer;\r
25 \r
26 import com.stevesoft.pat.Regex;\r
27 \r
28 import jalview.datamodel.Alignment;\r
29 import jalview.datamodel.AlignmentI;\r
30 import jalview.datamodel.DBRefSource;\r
31 import jalview.datamodel.SequenceI;\r
32 import jalview.datamodel.xdb.embl.EmblEntry;\r
33 import jalview.ws.ebi.EBIFetchClient;\r
34 import jalview.ws.seqfetcher.DbSourceProxy;\r
35 import jalview.ws.seqfetcher.DbSourceProxyImpl;\r
36 \r
37 /**\r
38  * Test class for accessing GeneDB - not yet finished.\r
39  * @author JimP\r
40  *\r
41  */\r
42 public class GeneDbSource extends EmblXmlSource implements DbSourceProxy\r
43 {\r
44 \r
45   public GeneDbSource() {\r
46     addDbSourceProperty(DBRefSource.DNASEQDB);\r
47     addDbSourceProperty(DBRefSource.CODINGSEQDB);\r
48   }\r
49   \r
50   /* (non-Javadoc)\r
51    * @see jalview.ws.DbSourceProxy#getAccessionSeparator()\r
52    */\r
53   public String getAccessionSeparator()\r
54   {\r
55     // TODO Auto-generated method stub\r
56     return null;\r
57   }\r
58 \r
59   /* (non-Javadoc)\r
60    * @see jalview.ws.DbSourceProxy#getAccessionValidator()\r
61    */\r
62   public Regex getAccessionValidator()\r
63   {\r
64     // TODO Auto-generated method stub\r
65     return null;\r
66   }\r
67 \r
68   /* (non-Javadoc)\r
69    * @see jalview.ws.DbSourceProxy#getDbSource()\r
70    */\r
71   public String getDbSource()\r
72   {\r
73     return DBRefSource.GENEDB;\r
74   }\r
75   /* (non-Javadoc)\r
76    * @see jalview.ws.DbSourceProxy#getDbVersion()\r
77    */\r
78   public String getDbVersion()\r
79   {\r
80     // TODO Auto-generated method stub\r
81     return "0";\r
82   }\r
83 \r
84   /* (non-Javadoc)\r
85    * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[])\r
86    */\r
87   public AlignmentI getSequenceRecords(String queries) throws Exception\r
88   {\r
89     // query of form http://www.genedb.org/genedb/ArtemisFormHandler?id=&dest=EMBL\r
90     // \r
91     return getEmblSequenceRecords(DBRefSource.GENEDB, queries);\r
92   }\r
93   /* (non-Javadoc)\r
94    * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)\r
95    */\r
96   public boolean isValidReference(String accession)\r
97   {\r
98     // TODO Auto-generated method stub\r
99     return false;\r
100   }\r
101 \r
102   /**\r
103    * return T.Brucei Mannosyl-Transferase TbPIG-M \r
104    */\r
105   public String getTestQuery()\r
106   {\r
107     return "Tb927.6.3300";\r
108   }\r
109 \r
110   public String getDbName()\r
111   {\r
112     return "GeneDB"; // getDbSource();\r
113   }\r
114 }\r