3 import jalview.ext.jmol.JmolParser;
4 import jalview.structure.StructureImportSettings;
6 import java.io.IOException;
8 public enum FileFormat implements FileFormatI
13 public AlignmentFileI getAlignmentFile(String inFile,
14 DataSourceType sourceType) throws IOException
16 return new FastaFile(inFile, sourceType);
20 public AlignmentFileI getAlignmentFile(FileParse source)
23 return new FastaFile(source);
27 public AlignmentFileI getAlignmentFile()
29 return new FastaFile();
35 public AlignmentFileI getAlignmentFile(String inFile,
36 DataSourceType sourceType) throws IOException
38 return new PfamFile(inFile, sourceType);
42 public AlignmentFileI getAlignmentFile(FileParse source)
45 return new PfamFile(source);
49 public AlignmentFileI getAlignmentFile()
51 return new PfamFile();
57 public AlignmentFileI getAlignmentFile(String inFile,
58 DataSourceType sourceType) throws IOException
60 return new StockholmFile(inFile, sourceType);
63 public AlignmentFileI getAlignmentFile(FileParse source)
66 return new StockholmFile(source);
70 public AlignmentFileI getAlignmentFile()
72 return new StockholmFile();
79 public AlignmentFileI getAlignmentFile(String inFile,
80 DataSourceType sourceType) throws IOException
82 return new SimpleBlastFile(inFile, sourceType);
86 public AlignmentFileI getAlignmentFile(FileParse source)
89 return new SimpleBlastFile(source);
93 public AlignmentFileI getAlignmentFile()
95 return new SimpleBlastFile();
102 public AlignmentFileI getAlignmentFile(String inFile,
103 DataSourceType sourceType) throws IOException
105 return new PIRFile(inFile, sourceType);
108 public AlignmentFileI getAlignmentFile(FileParse source)
111 return new PIRFile(source);
115 public AlignmentFileI getAlignmentFile()
117 return new PIRFile();
123 public AlignmentFileI getAlignmentFile(String inFile,
124 DataSourceType sourceType) throws IOException
126 return new BLCFile(inFile, sourceType);
128 public AlignmentFileI getAlignmentFile(FileParse source)
131 return new BLCFile(source);
135 public AlignmentFileI getAlignmentFile()
137 return new BLCFile();
144 public AlignmentFileI getAlignmentFile(String inFile,
145 DataSourceType sourceType) throws IOException
147 return new HtmlFile(inFile, sourceType);
149 public AlignmentFileI getAlignmentFile(FileParse source)
152 return new HtmlFile(source);
156 public AlignmentFileI getAlignmentFile()
158 return new HtmlFile();
162 public boolean isComplexAlignFile()
171 public AlignmentFileI getAlignmentFile(String inFile,
172 DataSourceType sourceType) throws IOException
174 return new RnamlFile(inFile, sourceType);
176 public AlignmentFileI getAlignmentFile(FileParse source)
179 return new RnamlFile(source);
183 public AlignmentFileI getAlignmentFile()
185 return new RnamlFile();
192 public AlignmentFileI getAlignmentFile(String inFile,
193 DataSourceType sourceType) throws IOException
195 return new JSONFile(inFile, sourceType);
197 public AlignmentFileI getAlignmentFile(FileParse source)
200 return new JSONFile(source);
204 public AlignmentFileI getAlignmentFile()
206 return new JSONFile();
210 public boolean isComplexAlignFile()
219 public AlignmentFileI getAlignmentFile(String inFile,
220 DataSourceType sourceType) throws IOException
222 return new PileUpfile(inFile, sourceType);
224 public AlignmentFileI getAlignmentFile(FileParse source)
227 return new PileUpfile(source);
231 public AlignmentFileI getAlignmentFile()
233 return new PileUpfile();
240 public AlignmentFileI getAlignmentFile(String inFile,
241 DataSourceType sourceType) throws IOException
243 return new MSFfile(inFile, sourceType);
245 public AlignmentFileI getAlignmentFile(FileParse source)
248 return new MSFfile(source);
252 public AlignmentFileI getAlignmentFile()
254 return new MSFfile();
261 public AlignmentFileI getAlignmentFile(String inFile,
262 DataSourceType sourceType) throws IOException
264 return new ClustalFile(inFile, sourceType);
266 public AlignmentFileI getAlignmentFile(FileParse source)
269 return new ClustalFile(source);
273 public AlignmentFileI getAlignmentFile()
275 return new ClustalFile();
282 public AlignmentFileI getAlignmentFile(String inFile,
283 DataSourceType sourceType) throws IOException
285 return new PhylipFile(inFile, sourceType);
289 public AlignmentFileI getAlignmentFile(FileParse source)
292 return new PhylipFile(source);
296 public AlignmentFileI getAlignmentFile()
298 return new PhylipFile();
305 public AlignmentFileI getAlignmentFile(String inFile,
306 DataSourceType sourceType) throws IOException
308 JPredFile af = new JPredFile(inFile, sourceType);
309 af.removeNonSequences();
314 public AlignmentFileI getAlignmentFile(FileParse source)
317 JPredFile af = new JPredFile(source);
318 af.removeNonSequences();
323 public AlignmentFileI getAlignmentFile()
325 return null; // todo is this called?
332 public AlignmentFileI getAlignmentFile(String inFile,
333 DataSourceType sourceType) throws IOException
335 return new FeaturesFile(true, inFile, sourceType);
339 public AlignmentFileI getAlignmentFile(FileParse source)
342 return new FeaturesFile(source);
346 public AlignmentFileI getAlignmentFile()
348 return new FeaturesFile();
355 public AlignmentFileI getAlignmentFile(String inFile,
356 DataSourceType sourceType) throws IOException
358 // TODO obtain config value from preference settings.
359 // Set value to 'true' to test PDB processing with Jmol: JAL-1213
360 boolean isParseWithJMOL = !StructureImportSettings
361 .getCurrentDefaultFormat().equalsIgnoreCase("PDB");
364 return new JmolParser(
365 StructureImportSettings.isVisibleChainAnnotation(),
366 StructureImportSettings.isPredictSecondaryStructure(),
367 StructureImportSettings.isExternalSecondaryStructure(),
373 StructureImportSettings.setShowSeqFeatures(true);
374 return new MCview.PDBfile(
375 StructureImportSettings.isVisibleChainAnnotation(),
376 StructureImportSettings.isPredictSecondaryStructure(),
377 StructureImportSettings.isExternalSecondaryStructure(),
384 public AlignmentFileI getAlignmentFile(FileParse source)
387 boolean isParseWithJMOL = !StructureImportSettings
388 .getCurrentDefaultFormat().equalsIgnoreCase("PDB");
391 return new JmolParser(
392 StructureImportSettings.isVisibleChainAnnotation(),
393 StructureImportSettings.isPredictSecondaryStructure(),
394 StructureImportSettings.isExternalSecondaryStructure(),
399 StructureImportSettings.setShowSeqFeatures(true);
400 return new MCview.PDBfile(
401 StructureImportSettings.isVisibleChainAnnotation(),
402 StructureImportSettings.isPredictSecondaryStructure(),
403 StructureImportSettings.isExternalSecondaryStructure(),
409 public AlignmentFileI getAlignmentFile()
411 return new JmolParser(); // todo or null?
419 public AlignmentFileI getAlignmentFile(String inFile,
420 DataSourceType sourceType) throws IOException
422 return new JmolParser(
423 StructureImportSettings.isVisibleChainAnnotation(),
424 StructureImportSettings.isPredictSecondaryStructure(),
425 StructureImportSettings.isExternalSecondaryStructure(),
430 public AlignmentFileI getAlignmentFile(FileParse source)
433 return new JmolParser(
434 StructureImportSettings.isVisibleChainAnnotation(),
435 StructureImportSettings.isPredictSecondaryStructure(),
436 StructureImportSettings.isExternalSecondaryStructure(),
441 public AlignmentFileI getAlignmentFile()
443 return new JmolParser(); // todo or null?
450 public AlignmentFileI getAlignmentFile(String inFile,
451 DataSourceType sourceType) throws IOException
457 public AlignmentFileI getAlignmentFile(FileParse source)
464 public AlignmentFileI getAlignmentFile()
471 public boolean isComplexAlignFile()
477 public String getShortDescription()