X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2FEmblSource.java;h=08c020e982219696a9ba89e49994323124ae0add;hb=33ddded54e265fccf85851d0ac3ad047ca4a8459;hp=f24579787672b1932e59126a77b1daf228a6e3fd;hpb=08fbe7c3d40a4077ab519334952a079968c07cd1;p=jalview.git diff --git a/src/jalview/ws/dbsources/EmblSource.java b/src/jalview/ws/dbsources/EmblSource.java index f245797..08c020e 100644 --- a/src/jalview/ws/dbsources/EmblSource.java +++ b/src/jalview/ws/dbsources/EmblSource.java @@ -1,5 +1,20 @@ -/** +/* + * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1) + * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package jalview.ws.dbsources; @@ -21,17 +36,20 @@ import jalview.ws.seqfetcher.DbSourceProxyImpl; /** * @author JimP - * + * */ public class EmblSource extends EmblXmlSource implements DbSourceProxy { - public EmblSource() { + public EmblSource() + { addDbSourceProperty(DBRefSource.DNASEQDB); addDbSourceProperty(DBRefSource.CODINGSEQDB); } - - /* (non-Javadoc) + + /* + * (non-Javadoc) + * * @see jalview.ws.DbSourceProxy#getAccessionSeparator() */ public String getAccessionSeparator() @@ -40,23 +58,29 @@ public class EmblSource extends EmblXmlSource implements DbSourceProxy return null; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.DbSourceProxy#getAccessionValidator() */ public Regex getAccessionValidator() { - // TODO Auto-generated method stub - return null; + return new com.stevesoft.pat.Regex("^[A-Z]+[0-9]+"); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.DbSourceProxy#getDbSource() */ public String getDbSource() { return DBRefSource.EMBL; } - /* (non-Javadoc) + + /* + * (non-Javadoc) + * * @see jalview.ws.DbSourceProxy#getDbVersion() */ public String getDbVersion() @@ -65,24 +89,31 @@ public class EmblSource extends EmblXmlSource implements DbSourceProxy return "0"; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[]) */ public AlignmentI getSequenceRecords(String queries) throws Exception { return getEmblSequenceRecords(DBRefSource.EMBL, queries); } - /* (non-Javadoc) + + /* + * (non-Javadoc) + * * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String) */ public boolean isValidReference(String accession) { - // TODO Auto-generated method stub - return false; + // most embl refs look like .. + + return (accession==null || accession.length()<2) ? false : getAccessionValidator().search(accession); + } /** - * return LHD_CHICK coding gene + * return LHD_CHICK coding gene */ public String getTestQuery() { @@ -91,6 +122,6 @@ public class EmblSource extends EmblXmlSource implements DbSourceProxy public String getDbName() { - return getDbSource(); + return "EMBL"; // getDbSource(); } }