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.util.Hashtable;
\r
22 import com.stevesoft.pat.Regex;
\r
24 import jalview.datamodel.AlignmentI;
\r
25 import jalview.datamodel.DBRefSource;
\r
26 import jalview.ws.seqfetcher.DbSourceProxy;
\r
28 public class EmblCdsSouce extends EmblXmlSource implements DbSourceProxy
\r
31 public EmblCdsSouce()
\r
34 addDbSourceProperty(DBRefSource.CODINGSEQDB);
\r
37 public String getAccessionSeparator()
\r
42 public Regex getAccessionValidator()
\r
44 return new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+");
\r
47 public String getDbSource()
\r
49 return DBRefSource.EMBLCDS;
\r
52 public String getDbVersion()
\r
54 return "0"; // TODO : this is dynamically set for a returned record - not
\r
58 public AlignmentI getSequenceRecords(String queries) throws Exception
\r
60 if (queries.indexOf(".") > -1)
\r
62 queries = queries.substring(0, queries.indexOf("."));
\r
64 return getEmblSequenceRecords(DBRefSource.EMBLCDS, queries);
\r
67 public boolean isValidReference(String accession)
\r
69 // most embl CDS refs look like ..
\r
70 // TODO: improve EMBLCDS regex
\r
71 return (accession == null || accession.length() < 2) ? false
\r
72 : getAccessionValidator().search(accession);
\r
76 * cDNA for LDHA_CHICK swissprot sequence
\r
78 public String getTestQuery()
\r
83 public String getDbName()
\r
85 return "EMBL (CDS)";
\r