1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.io; |
22 |
|
|
23 |
|
import jalview.datamodel.AlignmentI; |
24 |
|
import jalview.datamodel.PDBEntry; |
25 |
|
import jalview.ext.jmol.JmolParser; |
26 |
|
import jalview.structure.StructureImportSettings; |
27 |
|
|
28 |
|
import java.io.IOException; |
29 |
|
|
|
|
| 64.1% |
Uncovered Elements: 42 (117) |
Complexity: 54 |
Complexity Density: 0.87 |
|
30 |
|
public enum FileFormat implements FileFormatI |
31 |
|
{ |
32 |
|
Fasta("Fasta", "fa, fasta, mfa, fastq", true, true) |
33 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
34 |
195 |
@Override... |
35 |
|
public AlignmentFileReaderI getReader(FileParse source) |
36 |
|
throws IOException |
37 |
|
{ |
38 |
195 |
return new FastaFile(source); |
39 |
|
} |
40 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
41 |
47 |
@Override... |
42 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
43 |
|
{ |
44 |
47 |
return new FastaFile(); |
45 |
|
} |
46 |
|
}, |
47 |
|
Pfam("PFAM", "pfam", true, true) |
48 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
9 |
@Override... |
50 |
|
public AlignmentFileReaderI getReader(FileParse source) |
51 |
|
throws IOException |
52 |
|
{ |
53 |
9 |
return new PfamFile(source); |
54 |
|
} |
55 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
56 |
1 |
@Override... |
57 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
58 |
|
{ |
59 |
1 |
return new PfamFile(); |
60 |
|
} |
61 |
|
}, |
62 |
|
Stockholm("Stockholm", "sto,stk", true, true) |
63 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
42 |
@Override... |
65 |
|
public AlignmentFileReaderI getReader(FileParse source) |
66 |
|
throws IOException |
67 |
|
{ |
68 |
42 |
return new StockholmFile(source); |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
7 |
@Override... |
72 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
73 |
|
{ |
74 |
7 |
return new StockholmFile(al); |
75 |
|
} |
76 |
|
|
77 |
|
}, |
78 |
|
|
79 |
|
PIR("PIR", "pir", true, true) |
80 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
1 |
@Override... |
82 |
|
public AlignmentFileReaderI getReader(FileParse source) |
83 |
|
throws IOException |
84 |
|
{ |
85 |
1 |
return new PIRFile(source); |
86 |
|
} |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
1 |
@Override... |
89 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
90 |
|
{ |
91 |
1 |
return new PIRFile(); |
92 |
|
} |
93 |
|
}, |
94 |
|
BLC("BLC", "BLC", true, true) |
95 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
1 |
@Override... |
97 |
|
public AlignmentFileReaderI getReader(FileParse source) |
98 |
|
throws IOException |
99 |
|
{ |
100 |
1 |
return new BLCFile(source); |
101 |
|
} |
102 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
103 |
1 |
@Override... |
104 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
105 |
|
{ |
106 |
1 |
return new BLCFile(); |
107 |
|
} |
108 |
|
}, |
109 |
|
AMSA("AMSA", "amsa", true, true) |
110 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
111 |
1 |
@Override... |
112 |
|
public AlignmentFileReaderI getReader(FileParse source) |
113 |
|
throws IOException |
114 |
|
{ |
115 |
1 |
return new AMSAFile(source); |
116 |
|
} |
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
118 |
1 |
@Override... |
119 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
120 |
|
{ |
121 |
1 |
return new AMSAFile(al); |
122 |
|
} |
123 |
|
}, |
124 |
|
Html("HTML", "html", true, false) |
125 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
126 |
0 |
@Override... |
127 |
|
public AlignmentFileReaderI getReader(FileParse source) |
128 |
|
throws IOException |
129 |
|
{ |
130 |
0 |
return new HtmlFile(source); |
131 |
|
} |
132 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
133 |
0 |
@Override... |
134 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
135 |
|
{ |
136 |
0 |
return new HtmlFile(); |
137 |
|
} |
138 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
139 |
0 |
@Override... |
140 |
|
public boolean isComplexAlignFile() |
141 |
|
{ |
142 |
0 |
return true; |
143 |
|
} |
144 |
|
|
145 |
|
}, |
146 |
|
Rnaml("RNAML", "xml,rnaml", true, false) |
147 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
1 |
@Override... |
149 |
|
public AlignmentFileReaderI getReader(FileParse source) |
150 |
|
throws IOException |
151 |
|
{ |
152 |
1 |
return new RnamlFile(source); |
153 |
|
} |
154 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
155 |
0 |
@Override... |
156 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
157 |
|
{ |
158 |
0 |
return new RnamlFile(); |
159 |
|
} |
160 |
|
|
161 |
|
}, |
162 |
|
Json("JSON", "json", true, true) |
163 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
164 |
6 |
@Override... |
165 |
|
public AlignmentFileReaderI getReader(FileParse source) |
166 |
|
throws IOException |
167 |
|
{ |
168 |
6 |
return new JSONFile(source); |
169 |
|
} |
170 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
171 |
5 |
@Override... |
172 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
173 |
|
{ |
174 |
5 |
return new JSONFile(); |
175 |
|
} |
176 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
177 |
0 |
@Override... |
178 |
|
public boolean isComplexAlignFile() |
179 |
|
{ |
180 |
0 |
return true; |
181 |
|
} |
182 |
|
|
183 |
|
}, |
184 |
|
Pileup("PileUp", "pileup", true, true) |
185 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
186 |
1 |
@Override... |
187 |
|
public AlignmentFileReaderI getReader(FileParse source) |
188 |
|
throws IOException |
189 |
|
{ |
190 |
1 |
return new PileUpfile(source); |
191 |
|
} |
192 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
193 |
1 |
@Override... |
194 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
195 |
|
{ |
196 |
1 |
return new PileUpfile(); |
197 |
|
} |
198 |
|
|
199 |
|
}, |
200 |
|
MSF("MSF", "msf", true, true) |
201 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
202 |
1 |
@Override... |
203 |
|
public AlignmentFileReaderI getReader(FileParse source) |
204 |
|
throws IOException |
205 |
|
{ |
206 |
1 |
return new MSFfile(source); |
207 |
|
} |
208 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
209 |
1 |
@Override... |
210 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
211 |
|
{ |
212 |
1 |
return new MSFfile(); |
213 |
|
} |
214 |
|
|
215 |
|
}, |
216 |
|
Clustal("Clustal", "aln", true, true) |
217 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
218 |
1 |
@Override... |
219 |
|
public AlignmentFileReaderI getReader(FileParse source) |
220 |
|
throws IOException |
221 |
|
{ |
222 |
1 |
return new ClustalFile(source); |
223 |
|
} |
224 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
225 |
28 |
@Override... |
226 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
227 |
|
{ |
228 |
28 |
return new ClustalFile(); |
229 |
|
} |
230 |
|
}, |
231 |
|
Phylip("PHYLIP", "phy", true, true) |
232 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
233 |
7 |
@Override... |
234 |
|
public AlignmentFileReaderI getReader(FileParse source) |
235 |
|
throws IOException |
236 |
|
{ |
237 |
7 |
return new PhylipFile(source); |
238 |
|
} |
239 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
240 |
3 |
@Override... |
241 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
242 |
|
{ |
243 |
3 |
return new PhylipFile(); |
244 |
|
} |
245 |
|
}, |
246 |
|
Jnet("JnetFile", "", false, false) |
247 |
|
{ |
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
248 |
0 |
@Override... |
249 |
|
public AlignmentFileReaderI getReader(FileParse source) |
250 |
|
throws IOException |
251 |
|
{ |
252 |
0 |
JPredFile af = new JPredFile(source); |
253 |
0 |
af.removeNonSequences(); |
254 |
0 |
return af; |
255 |
|
} |
256 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
257 |
0 |
@Override... |
258 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
259 |
|
{ |
260 |
0 |
return null; |
261 |
|
} |
262 |
|
|
263 |
|
}, |
264 |
|
Features("GFF or Jalview features", "gff2,gff3", true, false) |
265 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
266 |
1 |
@Override... |
267 |
|
public AlignmentFileReaderI getReader(FileParse source) |
268 |
|
throws IOException |
269 |
|
{ |
270 |
1 |
return new FeaturesFile(source); |
271 |
|
} |
272 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
273 |
0 |
@Override... |
274 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
275 |
|
{ |
276 |
0 |
return new FeaturesFile(); |
277 |
|
} |
278 |
|
}, |
279 |
|
ScoreMatrix("Substitution matrix", "", false, false) |
280 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
281 |
0 |
@Override... |
282 |
|
public AlignmentFileReaderI getReader(FileParse source) |
283 |
|
throws IOException |
284 |
|
{ |
285 |
0 |
return new ScoreMatrixFile(source); |
286 |
|
} |
287 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
288 |
0 |
@Override... |
289 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
290 |
|
{ |
291 |
0 |
return null; |
292 |
|
} |
293 |
|
}, |
294 |
|
PDB("PDB", "pdb,ent", true, false) |
295 |
|
{ |
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
296 |
0 |
@Override... |
297 |
|
public AlignmentFileReaderI getReader(FileParse source) |
298 |
|
throws IOException |
299 |
|
{ |
300 |
0 |
boolean isParseWithJMOL = StructureImportSettings |
301 |
|
.getDefaultStructureFileFormat() != PDBEntry.Type.PDB; |
302 |
0 |
if (isParseWithJMOL) |
303 |
|
{ |
304 |
0 |
return new JmolParser(source); |
305 |
|
} |
306 |
|
else |
307 |
|
{ |
308 |
0 |
StructureImportSettings.setShowSeqFeatures(true); |
309 |
0 |
return new mc_view.PDBfile( |
310 |
|
StructureImportSettings.isVisibleChainAnnotation(), |
311 |
|
StructureImportSettings.isProcessSecondaryStructure(), |
312 |
|
StructureImportSettings.isExternalSecondaryStructure(), |
313 |
|
source); |
314 |
|
} |
315 |
|
} |
316 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
317 |
0 |
@Override... |
318 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
319 |
|
{ |
320 |
0 |
return new JmolParser(); |
321 |
|
} |
322 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
323 |
27 |
@Override... |
324 |
|
public boolean isStructureFile() |
325 |
|
{ |
326 |
27 |
return true; |
327 |
|
} |
328 |
|
}, |
329 |
|
MMCif("mmCIF", "cif", true, false) |
330 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
331 |
0 |
@Override... |
332 |
|
public AlignmentFileReaderI getReader(FileParse source) |
333 |
|
throws IOException |
334 |
|
{ |
335 |
0 |
return new JmolParser(source); |
336 |
|
} |
337 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
338 |
0 |
@Override... |
339 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
340 |
|
{ |
341 |
0 |
return new JmolParser(); |
342 |
|
} |
343 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
344 |
0 |
@Override... |
345 |
|
public boolean isStructureFile() |
346 |
|
{ |
347 |
0 |
return true; |
348 |
|
} |
349 |
|
}, |
350 |
|
Jalview("Jalview", "jvp, jar", true, true) |
351 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
352 |
0 |
@Override... |
353 |
|
public AlignmentFileReaderI getReader(FileParse source) |
354 |
|
throws IOException |
355 |
|
{ |
356 |
0 |
return null; |
357 |
|
} |
358 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
359 |
0 |
@Override... |
360 |
|
public AlignmentFileWriterI getWriter(AlignmentI al) |
361 |
|
{ |
362 |
0 |
return null; |
363 |
|
} |
364 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
365 |
266 |
@Override... |
366 |
|
public boolean isTextFormat() |
367 |
|
{ |
368 |
266 |
return false; |
369 |
|
} |
370 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
371 |
33 |
@Override... |
372 |
|
public boolean isIdentifiable() |
373 |
|
{ |
374 |
33 |
return true; |
375 |
|
} |
376 |
|
}; |
377 |
|
|
378 |
|
private boolean writable; |
379 |
|
|
380 |
|
private boolean readable; |
381 |
|
|
382 |
|
private String extensions; |
383 |
|
|
384 |
|
private String name; |
385 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
386 |
43 |
@Override... |
387 |
|
public boolean isComplexAlignFile() |
388 |
|
{ |
389 |
43 |
return false; |
390 |
|
} |
391 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
392 |
2431 |
@Override... |
393 |
|
public boolean isReadable() |
394 |
|
{ |
395 |
2431 |
return readable; |
396 |
|
} |
397 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
398 |
6820 |
@Override... |
399 |
|
public boolean isWritable() |
400 |
|
{ |
401 |
6820 |
return writable; |
402 |
|
} |
403 |
|
|
404 |
|
|
405 |
|
|
406 |
|
|
407 |
|
@param |
408 |
|
@param |
409 |
|
|
410 |
|
@param |
411 |
|
@param |
412 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
413 |
361 |
private FileFormat(String shortName, String extensions,... |
414 |
|
boolean isReadable, boolean isWritable) |
415 |
|
{ |
416 |
361 |
this.name = shortName; |
417 |
361 |
this.extensions = extensions; |
418 |
361 |
this.readable = isReadable; |
419 |
361 |
this.writable = isWritable; |
420 |
|
} |
421 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
422 |
325 |
@Override... |
423 |
|
public String getExtensions() |
424 |
|
{ |
425 |
325 |
return extensions; |
426 |
|
} |
427 |
|
|
428 |
|
|
429 |
|
|
430 |
|
|
431 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
432 |
7730 |
@Override... |
433 |
|
public String getName() |
434 |
|
{ |
435 |
7730 |
return name; |
436 |
|
} |
437 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
438 |
2925 |
@Override... |
439 |
|
public boolean isTextFormat() |
440 |
|
{ |
441 |
2925 |
return true; |
442 |
|
} |
443 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
444 |
359 |
@Override... |
445 |
|
public boolean isStructureFile() |
446 |
|
{ |
447 |
359 |
return false; |
448 |
|
} |
449 |
|
|
450 |
|
|
451 |
|
|
452 |
|
|
453 |
|
|
454 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
455 |
598 |
public boolean isIdentifiable()... |
456 |
|
{ |
457 |
598 |
return true; |
458 |
|
} |
459 |
|
} |