1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.io.gff; |
22 |
|
|
23 |
|
import jalview.datamodel.AlignmentI; |
24 |
|
import jalview.datamodel.SequenceFeature; |
25 |
|
import jalview.datamodel.SequenceI; |
26 |
|
import jalview.util.StringUtils; |
27 |
|
|
28 |
|
import java.io.IOException; |
29 |
|
import java.util.List; |
30 |
|
import java.util.Map; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
|
|
| 0% |
Uncovered Elements: 30 (30) |
Complexity: 11 |
Complexity Density: 0.61 |
|
35 |
|
public class InterProScanHelper extends Gff3Helper |
36 |
|
{ |
37 |
|
private static final String INTER_PRO_SCAN = "InterProScan"; |
38 |
|
|
39 |
|
private static final String SIGNATURE_DESC = "signature_desc"; |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
@param |
45 |
|
|
46 |
|
@param |
47 |
|
|
48 |
|
@param |
49 |
|
|
50 |
|
@param |
51 |
|
|
52 |
|
@param |
53 |
|
|
54 |
|
@return |
55 |
|
|
56 |
|
|
57 |
|
@throws |
58 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
59 |
0 |
@Override... |
60 |
|
public SequenceFeature processGff(SequenceI seq, String[] gff, |
61 |
|
AlignmentI align, List<SequenceI> newseqs, |
62 |
|
boolean relaxedIdMatching) throws IOException |
63 |
|
{ |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
0 |
if (".".equals(gff[SOURCE_COL])) |
68 |
|
{ |
69 |
0 |
return null; |
70 |
|
} |
71 |
|
|
72 |
0 |
return super.processGff(seq, gff, align, newseqs, relaxedIdMatching); |
73 |
|
} |
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
84 |
0 |
@Override... |
85 |
|
protected SequenceFeature buildSequenceFeature(String[] gff, |
86 |
|
Map<String, List<String>> attributes) |
87 |
|
{ |
88 |
0 |
SequenceFeature sf = super.buildSequenceFeature(gff, SOURCE_COL, |
89 |
|
INTER_PRO_SCAN, attributes); |
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
0 |
List<String> desc = attributes.get(SIGNATURE_DESC); |
95 |
0 |
String description = StringUtils.listToDelimitedString(desc, ", "); |
96 |
0 |
if (description.length() > 0) |
97 |
|
{ |
98 |
0 |
sf.setDescription(description); |
99 |
|
} |
100 |
|
|
101 |
0 |
return sf; |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
@param |
108 |
|
@return |
109 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 4 |
Complexity Density: 0.8 |
|
110 |
0 |
public static boolean recognises(String[] columns)... |
111 |
|
{ |
112 |
0 |
SequenceOntologyI so = SequenceOntologyFactory.getInstance(); |
113 |
0 |
String type = columns[TYPE_COL]; |
114 |
0 |
if (so.isA(type, SequenceOntologyI.PROTEIN_MATCH) |
115 |
|
|| (".".equals(columns[SOURCE_COL]) |
116 |
|
&& so.isA(type, SequenceOntologyI.POLYPEPTIDE))) |
117 |
|
{ |
118 |
0 |
return true; |
119 |
|
} |
120 |
0 |
return false; |
121 |
|
} |
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
127 |
0 |
@Override... |
128 |
|
protected String findTargetId(String target, |
129 |
|
Map<String, List<String>> set) |
130 |
|
{ |
131 |
0 |
List<String> ids = set.get(ID); |
132 |
0 |
if (ids == null || ids.size() != 1) |
133 |
|
{ |
134 |
0 |
return null; |
135 |
|
} |
136 |
0 |
return ids.get(0); |
137 |
|
} |
138 |
|
|
139 |
|
} |