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.AlignmentI; |
24 |
|
import jalview.datamodel.SequenceFeature; |
25 |
|
|
26 |
|
import com.stevesoft.pat.Regex; |
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
@author |
32 |
|
|
33 |
|
|
|
|
| 42.9% |
Uncovered Elements: 16 (28) |
Complexity: 13 |
Complexity Density: 0.87 |
|
34 |
|
public class EnsemblProtein extends EnsemblSeqProxy |
35 |
|
{ |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
private static final Regex ACCESSION_REGEX = new Regex( |
42 |
|
"(ENS([A-Z]{3}|)P[0-9]{11}$)" + "|" + "(CCDS[0-9.]{3,}$)"); |
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
4 |
public EnsemblProtein()... |
48 |
|
{ |
49 |
4 |
super(); |
50 |
|
} |
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
@param |
56 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
0 |
public EnsemblProtein(String d)... |
58 |
|
{ |
59 |
0 |
super(d); |
60 |
|
} |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0 |
@Override... |
63 |
|
public String getDbName() |
64 |
|
{ |
65 |
0 |
return "ENSEMBL (Protein)"; |
66 |
|
} |
67 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
0 |
@Override... |
69 |
|
protected EnsemblSeqType getSourceEnsemblType() |
70 |
|
{ |
71 |
0 |
return EnsemblSeqType.PROTEIN; |
72 |
|
} |
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
0 |
@Override... |
78 |
|
public boolean isDnaCoding() |
79 |
|
{ |
80 |
0 |
return false; |
81 |
|
} |
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
0 |
@Override... |
87 |
|
public String getTestQuery() |
88 |
|
{ |
89 |
0 |
return "ENSP00000288602"; |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
96 |
0 |
@Override... |
97 |
|
protected void addFeaturesAndProduct(String accId, AlignmentI alignment) |
98 |
|
{ |
99 |
|
} |
100 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
0 |
@Override... |
102 |
|
protected EnsemblFeatureType[] getFeaturesToFetch() |
103 |
|
{ |
104 |
|
|
105 |
0 |
return null; |
106 |
|
} |
107 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
108 |
0 |
@Override... |
109 |
|
protected boolean identifiesSequence(SequenceFeature sf, String accId) |
110 |
|
{ |
111 |
|
|
112 |
0 |
return false; |
113 |
|
} |
114 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
5 |
@Override... |
116 |
|
public Regex getAccessionValidator() |
117 |
|
{ |
118 |
5 |
return ACCESSION_REGEX; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
|
|
| 87.5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
126 |
6 |
@Override... |
127 |
|
public String getAccessionIdFromQuery(String query) |
128 |
|
{ |
129 |
6 |
String accId = super.getAccessionIdFromQuery(query); |
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
6 |
if (accId != null && accId.length() >= 12) |
137 |
|
{ |
138 |
6 |
char[] chars = accId.toCharArray(); |
139 |
6 |
chars[chars.length - 12] = 'P'; |
140 |
6 |
accId = new String(chars); |
141 |
|
} |
142 |
6 |
return accId; |
143 |
|
} |
144 |
|
|
145 |
|
} |