2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
5 * This file is part of Jalview.
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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
18 package jalview.ws.dbsources;
21 import java.util.Hashtable;
22 import java.util.Iterator;
23 import java.util.StringTokenizer;
25 import com.stevesoft.pat.Regex;
27 import jalview.datamodel.Alignment;
28 import jalview.datamodel.AlignmentI;
29 import jalview.datamodel.DBRefSource;
30 import jalview.datamodel.SequenceI;
31 import jalview.datamodel.xdb.embl.EmblEntry;
32 import jalview.ws.ebi.EBIFetchClient;
33 import jalview.ws.seqfetcher.DbSourceProxy;
34 import jalview.ws.seqfetcher.DbSourceProxyImpl;
40 public class EmblSource extends EmblXmlSource implements DbSourceProxy
45 addDbSourceProperty(DBRefSource.DNASEQDB);
46 addDbSourceProperty(DBRefSource.CODINGSEQDB);
52 * @see jalview.ws.DbSourceProxy#getAccessionSeparator()
54 public String getAccessionSeparator()
56 // TODO Auto-generated method stub
63 * @see jalview.ws.DbSourceProxy#getAccessionValidator()
65 public Regex getAccessionValidator()
67 return new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+");
73 * @see jalview.ws.DbSourceProxy#getDbSource()
75 public String getDbSource()
77 return DBRefSource.EMBL;
83 * @see jalview.ws.DbSourceProxy#getDbVersion()
85 public String getDbVersion()
87 // TODO Auto-generated method stub
94 * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[])
96 public AlignmentI getSequenceRecords(String queries) throws Exception
98 return getEmblSequenceRecords(DBRefSource.EMBL, queries);
104 * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
106 public boolean isValidReference(String accession)
108 // most embl refs look like ..
110 return (accession == null || accession.length() < 2) ? false
111 : getAccessionValidator().search(accession);
116 * return LHD_CHICK coding gene
118 public String getTestQuery()
123 public String getDbName()
125 return "EMBL"; // getDbSource();