1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.ext.ensembl; |
22 |
|
|
23 |
|
import jalview.datamodel.SequenceFeature; |
24 |
|
import jalview.datamodel.SequenceI; |
25 |
|
import jalview.io.gff.SequenceOntologyFactory; |
26 |
|
import jalview.io.gff.SequenceOntologyI; |
27 |
|
|
28 |
|
import java.util.ArrayList; |
29 |
|
import java.util.List; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
@author |
39 |
|
|
40 |
|
|
|
|
| 58.1% |
Uncovered Elements: 13 (31) |
Complexity: 10 |
Complexity Density: 0.53 |
|
41 |
|
public class EnsemblCds extends EnsemblSeqProxy |
42 |
|
{ |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
private static final EnsemblFeatureType[] FEATURES_TO_FETCH = { |
48 |
|
EnsemblFeatureType.cds, EnsemblFeatureType.exon, |
49 |
|
EnsemblFeatureType.variation }; |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
4 |
public EnsemblCds()... |
55 |
|
{ |
56 |
4 |
super(); |
57 |
|
} |
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
@param |
63 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
0 |
public EnsemblCds(String d)... |
65 |
|
{ |
66 |
0 |
super(d); |
67 |
|
} |
68 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
69 |
0 |
@Override... |
70 |
|
public String getDbName() |
71 |
|
{ |
72 |
0 |
return "ENSEMBL (CDS)"; |
73 |
|
} |
74 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
0 |
@Override... |
76 |
|
protected EnsemblSeqType getSourceEnsemblType() |
77 |
|
{ |
78 |
0 |
return EnsemblSeqType.CDS; |
79 |
|
} |
80 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
0 |
@Override... |
82 |
|
protected EnsemblFeatureType[] getFeaturesToFetch() |
83 |
|
{ |
84 |
0 |
return FEATURES_TO_FETCH; |
85 |
|
} |
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
93 |
5 |
@Override... |
94 |
|
protected boolean retainFeature(SequenceFeature sf, String accessionId) |
95 |
|
{ |
96 |
5 |
if (SequenceOntologyFactory.getInstance().isA(sf.getType(), |
97 |
|
SequenceOntologyI.CDS)) |
98 |
|
{ |
99 |
2 |
return false; |
100 |
|
} |
101 |
3 |
return featureMayBelong(sf, accessionId); |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
109 |
2 |
@Override... |
110 |
|
protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq, |
111 |
|
String accId) |
112 |
|
{ |
113 |
2 |
List<SequenceFeature> result = new ArrayList<>(); |
114 |
2 |
List<SequenceFeature> sfs = seq.getFeatures() |
115 |
|
.getFeaturesByOntology(SequenceOntologyI.CDS); |
116 |
2 |
for (SequenceFeature sf : sfs) |
117 |
|
{ |
118 |
7 |
String parentFeature = (String) sf.getValue(PARENT); |
119 |
7 |
if (accId.equals(parentFeature)) |
120 |
|
{ |
121 |
4 |
result.add(sf); |
122 |
|
} |
123 |
|
} |
124 |
2 |
return result; |
125 |
|
} |
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
133 |
0 |
protected List<int[]> getCdsRanges(SequenceI dnaSeq)... |
134 |
|
{ |
135 |
0 |
int len = dnaSeq.getLength(); |
136 |
0 |
List<int[]> ranges = new ArrayList<>(); |
137 |
0 |
ranges.add(new int[] { 1, len }); |
138 |
0 |
return ranges; |
139 |
|
} |
140 |
|
|
141 |
|
} |