X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2FEmblSource.java;h=6a3b3f79d4707724ec45cd413e0a806a0862d321;hb=445459c0de00fb5fdb82e818c551950ff90069fe;hp=6b7756e1a6315634391b5a98c8c53b043c372763;hpb=6b406c397d41a0f2d84b75f13e7ab478932bf57d;p=jalview.git diff --git a/src/jalview/ws/dbsources/EmblSource.java b/src/jalview/ws/dbsources/EmblSource.java index 6b7756e..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; @@ -15,23 +29,26 @@ import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceI; import jalview.datamodel.xdb.embl.EmblEntry; -import jalview.ws.EBIFetchClient; +import jalview.ws.ebi.EBIFetchClient; import jalview.ws.seqfetcher.DbSourceProxy; 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(); + } }