X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2FEmblSource.java;h=6a3b3f79d4707724ec45cd413e0a806a0862d321;hb=797df64fa2a0a30773d0f48f5494d4155e5a8be3;hp=5ae7a728610023c4ea460e27067293357cc2b68b;hpb=0eda2ac2f334f55f6e5f137789453a9f4dfe4d73;p=jalview.git diff --git a/src/jalview/ws/dbsources/EmblSource.java b/src/jalview/ws/dbsources/EmblSource.java index 5ae7a72..6a3b3f7 100644 --- a/src/jalview/ws/dbsources/EmblSource.java +++ b/src/jalview/ws/dbsources/EmblSource.java @@ -1,5 +1,19 @@ -/** +/* + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle + * + * This file is part of Jalview. + * + * Jalview 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 3 of the License, or (at your option) any later version. + * + * Jalview 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 Jalview. If not, see . */ package jalview.ws.dbsources; @@ -21,17 +35,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 +57,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,28 +88,40 @@ 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() { return "X53828"; } + public String getDbName() + { + return "EMBL"; // getDbSource(); + } }