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.SequenceOntologyI; |
26 |
|
|
27 |
|
import java.util.ArrayList; |
28 |
|
import java.util.List; |
29 |
|
|
30 |
|
import com.stevesoft.pat.Regex; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
@author |
38 |
|
|
39 |
|
|
|
|
| 66.7% |
Uncovered Elements: 10 (30) |
Complexity: 11 |
Complexity Density: 0.65 |
|
40 |
|
public class EnsemblCdna extends EnsemblSeqProxy |
41 |
|
{ |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
private static final Regex ACCESSION_REGEX = new Regex( |
48 |
|
"(ENS([A-Z]{3}|)[TG][0-9]{11}$)" + "|" + "(CCDS[0-9.]{3,}$)"); |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
private static final EnsemblFeatureType[] FEATURES_TO_FETCH = { |
55 |
|
EnsemblFeatureType.exon, EnsemblFeatureType.cds, |
56 |
|
EnsemblFeatureType.variation }; |
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
10 |
public EnsemblCdna()... |
62 |
|
{ |
63 |
10 |
super(); |
64 |
|
} |
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
@param |
70 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
0 |
public EnsemblCdna(String d)... |
72 |
|
{ |
73 |
0 |
super(d); |
74 |
|
} |
75 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
76 |
0 |
@Override... |
77 |
|
public String getDbName() |
78 |
|
{ |
79 |
0 |
return "ENSEMBL (CDNA)"; |
80 |
|
} |
81 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
0 |
@Override... |
83 |
|
protected EnsemblSeqType getSourceEnsemblType() |
84 |
|
{ |
85 |
0 |
return EnsemblSeqType.CDNA; |
86 |
|
} |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
6 |
@Override... |
89 |
|
public Regex getAccessionValidator() |
90 |
|
{ |
91 |
6 |
return ACCESSION_REGEX; |
92 |
|
} |
93 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
94 |
0 |
@Override... |
95 |
|
protected EnsemblFeatureType[] getFeaturesToFetch() |
96 |
|
{ |
97 |
0 |
return FEATURES_TO_FETCH; |
98 |
|
} |
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
104 |
7 |
@Override... |
105 |
|
protected boolean retainFeature(SequenceFeature sf, String accessionId) |
106 |
|
{ |
107 |
7 |
if (isTranscript(sf.getType())) |
108 |
|
{ |
109 |
3 |
return false; |
110 |
|
} |
111 |
4 |
return featureMayBelong(sf, accessionId); |
112 |
|
} |
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 2 |
Complexity Density: 0.29 |
|
119 |
4 |
@Override... |
120 |
|
protected List<SequenceFeature> getIdentifyingFeatures(SequenceI seq, |
121 |
|
String accId) |
122 |
|
{ |
123 |
4 |
List<SequenceFeature> result = new ArrayList<>(); |
124 |
4 |
List<SequenceFeature> sfs = seq.getFeatures() |
125 |
|
.getFeaturesByOntology(SequenceOntologyI.EXON); |
126 |
4 |
for (SequenceFeature sf : sfs) |
127 |
|
{ |
128 |
12 |
String parentFeature = (String) sf.getValue(PARENT); |
129 |
12 |
if (accId.equals(parentFeature)) |
130 |
|
{ |
131 |
6 |
result.add(sf); |
132 |
|
} |
133 |
|
} |
134 |
|
|
135 |
4 |
return result; |
136 |
|
} |
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
142 |
0 |
@Override... |
143 |
|
protected String getObjectType() |
144 |
|
{ |
145 |
0 |
return OBJECT_TYPE_TRANSCRIPT; |
146 |
|
} |
147 |
|
|
148 |
|
} |