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