Clover icon

jalviewX

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

File EnsemblGenome.java

 

Coverage histogram

../../../img/srcFileCovDistChart7.png
28% of files have more coverage

Code metrics

6
13
7
1
115
53
10
0.77
1.86
7
1.43

Classes

Class Line # Actions
EnsemblGenome 33 13 10 8
0.692307769.2%
 

Contributing tests

This file is covered by 3 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.ext.ensembl;
22   
23    import jalview.datamodel.SequenceFeature;
24   
25    /**
26    * A client to fetch genomic sequence from Ensembl
27    *
28    * TODO: not currently used - delete?
29    *
30    * @author gmcarstairs
31    *
32    */
 
33    public class EnsemblGenome extends EnsemblSeqProxy
34    {
35    /*
36    * fetch transcript features on genomic sequence (to identify the transcript
37    * regions) and cds, exon and variation features (to retain)
38    */
39    private static final EnsemblFeatureType[] FEATURES_TO_FETCH = {
40    EnsemblFeatureType.transcript, EnsemblFeatureType.exon,
41    EnsemblFeatureType.cds, EnsemblFeatureType.variation };
42   
43    /**
44    * Default constructor (to use rest.ensembl.org)
45    */
 
46  3 toggle public EnsemblGenome()
47    {
48  3 super();
49    }
50   
51    /**
52    * Constructor given the target domain to fetch data from
53    *
54    * @param d
55    */
 
56  0 toggle public EnsemblGenome(String d)
57    {
58  0 super(d);
59    }
60   
 
61  0 toggle @Override
62    public String getDbName()
63    {
64  0 return "ENSEMBL (Genomic)";
65    }
66   
 
67  0 toggle @Override
68    protected EnsemblSeqType getSourceEnsemblType()
69    {
70  0 return EnsemblSeqType.GENOMIC;
71    }
72   
 
73  0 toggle @Override
74    protected EnsemblFeatureType[] getFeaturesToFetch()
75    {
76  0 return FEATURES_TO_FETCH;
77    }
78   
79    /**
80    * Answers true unless the feature type is 'transcript' (or a sub-type of
81    * transcript in the Sequence Ontology), or has a parent other than the given
82    * accession id. Transcript features are only retrieved in order to identify
83    * the transcript sequence range, and are redundant information on the
84    * transcript sequence itself.
85    */
 
86  6 toggle @Override
87    protected boolean retainFeature(SequenceFeature sf, String accessionId)
88    {
89  6 if (isTranscript(sf.getType()))
90    {
91  3 return false;
92    }
93  3 return featureMayBelong(sf, accessionId);
94    }
95   
96    /**
97    * Answers true if the sequence feature type is 'transcript' (or a subtype of
98    * transcript in the Sequence Ontology), and the ID of the feature is the
99    * transcript we are retrieving
100    */
 
101  12 toggle @Override
102    protected boolean identifiesSequence(SequenceFeature sf, String accId)
103    {
104  12 if (isTranscript(sf.getType()))
105    {
106  9 String id = (String) sf.getValue("ID");
107  9 if (("transcript:" + accId).equals(id))
108    {
109  6 return true;
110    }
111    }
112  6 return false;
113    }
114   
115    }