- if (format.equals("FASTA"))
- {
- afile = new FastaFile(inFile, type);
- }
- else if (format.equals("MSF"))
- {
- afile = new MSFfile(inFile, type);
- }
- else if (format.equals("PileUp"))
- {
- afile = new PileUpfile(inFile, type);
- }
- else if (format.equals("CLUSTAL"))
- {
- afile = new ClustalFile(inFile, type);
- }
- else if (format.equals("BLC"))
- {
- afile = new BLCFile(inFile, type);
- }
- else if (format.equals("PIR"))
- {
- afile = new PIRFile(inFile, type);
- }
- else if (format.equals("PFAM"))
- {
- afile = new PfamFile(inFile, type);
- }
- else if (format.equals("JnetFile"))
- {
- afile = new JPredFile(inFile, type);
- ((JPredFile) afile).removeNonSequences();
- }
- else if (format.equals("PDB"))
- {
- afile = new MCview.PDBfile(inFile, type);
- // Uncomment to test Jmol data based PDB processing: JAL-1213
- // afile = new jalview.ext.jmol.PDBFileWithJmol(inFile, type);
- }
- else if (format.equals("STH"))
- {
- afile = new StockholmFile(inFile, type);
- }
- else if (format.equals("SimpleBLAST"))
- {
- afile = new SimpleBlastFile(inFile, type);
+ if (fileFormat.isStructureFile())
+ {
+ String structureParser = StructureImportSettings
+ .getDefaultPDBFileParser();
+ boolean isParseWithJMOL = structureParser.equalsIgnoreCase(
+ StructureImportSettings.StructureParser.JMOL_PARSER
+ .toString());
+ StructureImportSettings.addSettings(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct);
+ if (isParseWithJMOL)
+ {
+ // needs a File option
+ alignFile = new JmolParser(selectedFile == null ? inFile : selectedFile, sourceType);
+ }
+ else
+ {
+ // todo is mc_view parsing obsolete yet? JAL-2120
+ StructureImportSettings.setShowSeqFeatures(true);
+ alignFile = new mc_view.PDBfile(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, inFile,
+ sourceType);
+ }
+ ((StructureFile) alignFile).setDbRefType(
+ FileFormat.PDB.equals(fileFormat) ? Type.PDB : Type.MMCIF);