Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.ws.dbsources

File EmblSource.java

 

Coverage histogram

../../../img/srcFileCovDistChart3.png
47% of files have more coverage

Code metrics

2
10
10
1
132
57
12
1.2
1
10
1.2

Classes

Class Line # Actions
EmblSource 32 10 12 16
0.2727272827.3%
 

Contributing tests

This file is covered by 79 tests. .

Source view

1    /*
2    * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3    * Copyright (C) $$Year-Rel$$ The Jalview Authors
4    *
5    * This file is part of Jalview.
6    *
7    * Jalview is free software: you can redistribute it and/or
8    * modify it under the terms of the GNU General Public License
9    * as published by the Free Software Foundation, either version 3
10    * of the License, or (at your option) any later version.
11    *
12    * Jalview is distributed in the hope that it will be useful, but
13    * WITHOUT ANY WARRANTY; without even the implied warranty
14    * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15    * PURPOSE. See the GNU General Public License for more details.
16    *
17    * You should have received a copy of the GNU General Public License
18    * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19    * The Jalview Authors are detailed in the 'AUTHORS' file.
20    */
21    package jalview.ws.dbsources;
22   
23    import jalview.datamodel.AlignmentI;
24    import jalview.datamodel.DBRefSource;
25   
26    import com.stevesoft.pat.Regex;
27   
28    /**
29    * @author JimP
30    *
31    */
 
32    public class EmblSource extends EmblXmlSource
33    {
34   
 
35  6 toggle public EmblSource()
36    {
37  6 super();
38    }
39   
40    /*
41    * (non-Javadoc)
42    *
43    * @see jalview.ws.DbSourceProxy#getAccessionSeparator()
44    */
 
45  0 toggle @Override
46    public String getAccessionSeparator()
47    {
48    // TODO Auto-generated method stub
49  0 return null;
50    }
51   
52    /*
53    * (non-Javadoc)
54    *
55    * @see jalview.ws.DbSourceProxy#getAccessionValidator()
56    */
 
57  0 toggle @Override
58    public Regex getAccessionValidator()
59    {
60  0 return new Regex("^[A-Z]+[0-9]+");
61    }
62   
63    /*
64    * (non-Javadoc)
65    *
66    * @see jalview.ws.DbSourceProxy#getDbSource()
67    */
 
68  1114 toggle @Override
69    public String getDbSource()
70    {
71  1114 return DBRefSource.EMBL;
72    }
73   
74    /*
75    * (non-Javadoc)
76    *
77    * @see jalview.ws.DbSourceProxy#getDbVersion()
78    */
 
79  0 toggle @Override
80    public String getDbVersion()
81    {
82    // TODO Auto-generated method stub
83  0 return "0";
84    }
85   
86    /*
87    * (non-Javadoc)
88    *
89    * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[])
90    */
 
91  0 toggle @Override
92    public AlignmentI getSequenceRecords(String queries) throws Exception
93    {
94  0 return getEmblSequenceRecords(DBRefSource.EMBL, queries);
95    }
96   
97    /*
98    * (non-Javadoc)
99    *
100    * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
101    */
 
102  0 toggle @Override
103    public boolean isValidReference(String accession)
104    {
105    // most embl refs look like ..
106   
107  0 return (accession == null || accession.length() < 2) ? false
108    : getAccessionValidator().search(accession);
109   
110    }
111   
112    /**
113    * return LHD_CHICK coding gene
114    */
 
115  0 toggle @Override
116    public String getTestQuery()
117    {
118  0 return "X53828";
119    }
120   
 
121  1108 toggle @Override
122    public String getDbName()
123    {
124  1108 return "EMBL"; // getDbSource();
125    }
126   
 
127  0 toggle @Override
128    public int getTier()
129    {
130  0 return 0;
131    }
132    }