import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
+import jalview.datamodel.PDBEntry.Type;
import jalview.datamodel.SequenceI;
+import jalview.ext.jmol.JmolParser;
import jalview.structure.StructureImportSettings;
import java.io.File;
{
if (fileFormat == FileFormat.PDB || fileFormat == FileFormat.MMCif)
{
- StructureImportSettings.addSettings(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct);
- alignFile = fileFormat.getAlignmentFile(inFile, sourceType);
+ // TODO obtain config value from preference settings.
+ // Set value to 'true' to test PDB processing with Jmol: JAL-1213
+ boolean isParseWithJMOL = StructureImportSettings
+ .getDefaultPDBFileParser().equalsIgnoreCase(
+ StructureImportSettings.StructureParser.JMOL_PARSER
+ .toString());
+ if (isParseWithJMOL)
+ {
+ StructureImportSettings.addSettings(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct);
+ alignFile = new JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, inFile,
+ sourceType);
+ }
+ else
+ {
+ StructureImportSettings.addSettings(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct);
+ StructureImportSettings.setShowSeqFeatures(true);
+ alignFile = new MCview.PDBfile(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, inFile,
+ sourceType);
+ }
+ ((StructureFile) alignFile)
+ .setDbRefType(fileFormat == FileFormat.PDB ? Type.PDB
+ : Type.MMCIF);
}
else
{
{
if (format == FileFormat.PDB || format == FileFormat.MMCif)
{
- StructureImportSettings.addSettings(annotFromStructure,
- localSecondaryStruct, serviceSecondaryStruct);
- alignFile = format.getAlignmentFile(source);
+ // TODO obtain config value from preference settings
+ boolean isParseWithJMOL = false;
+ if (isParseWithJMOL)
+ {
+ StructureImportSettings.addSettings(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct);
+ alignFile = new JmolParser(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, source);
+ }
+ else
+ {
+ StructureImportSettings.setShowSeqFeatures(true);
+ alignFile = new MCview.PDBfile(annotFromStructure,
+ localSecondaryStruct, serviceSecondaryStruct, source);
+ }
+ ((StructureFile) alignFile).setDbRefType(Type.PDB);
}
else
{