JAL-1645 Version-Rel Version 2.9 Year-Rel 2015 Licensing glob
[jalview.git] / src / jalview / ws / dbsources / GeneDbSource.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
3  * Copyright (C) 2015 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.ws.dbsources;
22
23 import jalview.datamodel.AlignmentI;
24 import jalview.datamodel.DBRefSource;
25 import jalview.ws.seqfetcher.DbSourceProxy;
26
27 import com.stevesoft.pat.Regex;
28
29 /**
30  * Test class for accessing GeneDB - not yet finished.
31  * 
32  * @author JimP
33  * 
34  */
35 public class GeneDbSource extends EmblXmlSource implements DbSourceProxy
36 {
37
38   public GeneDbSource()
39   {
40     addDbSourceProperty(DBRefSource.DNASEQDB);
41     addDbSourceProperty(DBRefSource.CODINGSEQDB);
42   }
43
44   /*
45    * (non-Javadoc)
46    * 
47    * @see jalview.ws.DbSourceProxy#getAccessionSeparator()
48    */
49   public String getAccessionSeparator()
50   {
51     // TODO Auto-generated method stub
52     return null;
53   }
54
55   /*
56    * (non-Javadoc)
57    * 
58    * @see jalview.ws.DbSourceProxy#getAccessionValidator()
59    */
60   public Regex getAccessionValidator()
61   {
62     // TODO Auto-generated method stub
63     return null;
64   }
65
66   /*
67    * (non-Javadoc)
68    * 
69    * @see jalview.ws.DbSourceProxy#getDbSource()
70    */
71   public String getDbSource()
72   {
73     return DBRefSource.GENEDB;
74   }
75
76   /*
77    * (non-Javadoc)
78    * 
79    * @see jalview.ws.DbSourceProxy#getDbVersion()
80    */
81   public String getDbVersion()
82   {
83     // TODO Auto-generated method stub
84     return "0";
85   }
86
87   /*
88    * (non-Javadoc)
89    * 
90    * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[])
91    */
92   public AlignmentI getSequenceRecords(String queries) throws Exception
93   {
94     // query of form
95     // http://www.genedb.org/genedb/ArtemisFormHandler?id=&dest=EMBL
96     //
97     return getEmblSequenceRecords(DBRefSource.GENEDB, queries);
98   }
99
100   /*
101    * (non-Javadoc)
102    * 
103    * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
104    */
105   public boolean isValidReference(String accession)
106   {
107     // TODO Auto-generated method stub
108     return false;
109   }
110
111   /**
112    * return T.Brucei Mannosyl-Transferase TbPIG-M
113    */
114   public String getTestQuery()
115   {
116     return "Tb927.6.3300";
117   }
118
119   public String getDbName()
120   {
121     return "GeneDB"; // getDbSource();
122   }
123
124   @Override
125   public int getTier()
126   {
127     return 0;
128   }
129 }