0227e358f894225f84298adb1ad86ef425ca972f
[jalview.git] / src / jalview / ws / dbsources / Pfam.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ 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.DBRefSource;
24
25 import com.stevesoft.pat.Regex;
26
27 /**
28  * TODO: later PFAM is a complex datasource - it could return a tree in addition
29  * to an alignment TODO: create interface to pass alignment properties and tree
30  * back to sequence fetcher
31  * 
32  * @author JimP
33  * 
34  */
35 abstract public class Pfam extends Xfam
36 {
37
38   public Pfam()
39   {
40     super();
41   }
42
43   /*
44    * (non-Javadoc)
45    * 
46    * @see jalview.ws.DbSourceProxy#getAccessionSeparator()
47    */
48   @Override
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   @Override
61   public Regex getAccessionValidator()
62   {
63     // TODO Auto-generated method stub
64     return null;
65   }
66
67   /*
68    * (non-Javadoc)
69    * 
70    * @see jalview.ws.DbSourceProxy#getDbSource() public String getDbSource() { *
71    * this doesn't work - DbSource is key for the hash of DbSourceProxy instances
72    * - 1:many mapping for DbSource to proxy will be lost. * suggest : PFAM is an
73    * 'alignment' source - means proxy is higher level than a sequence source.
74    * return jalview.datamodel.DBRefSource.PFAM; }
75    */
76
77   /*
78    * (non-Javadoc)
79    * 
80    * @see jalview.ws.DbSourceProxy#getDbSourceProperties() public Hashtable
81    * getDbSourceProperties() {
82    * 
83    * return null; }
84    */
85
86   /*
87    * (non-Javadoc)
88    * 
89    * @see jalview.ws.DbSourceProxy#getDbVersion()
90    */
91   @Override
92   public String getDbVersion()
93   {
94     // TODO Auto-generated method stub
95     return null;
96   }
97
98   /**
99    * Returns base URL for selected Pfam alignment type
100    * 
101    * @return PFAM URL stub for this DbSource
102    */
103   @Override
104   protected abstract String getXFAMURL();
105
106   /*
107    * (non-Javadoc)
108    * 
109    * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
110    */
111   @Override
112   public boolean isValidReference(String accession)
113   {
114     return accession.indexOf("PF") == 0;
115   }
116
117   /*
118    * public String getDbName() { return "PFAM"; // getDbSource(); }
119    */
120
121   @Override
122   public String getXfamSource()
123   {
124     return DBRefSource.PFAM;
125   }
126
127 }