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