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