package jalview.structure;
-import jalview.datamodel.DBRefSource;
-
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.PDBEntry.Type;
+
+/**
+ * bean holding settings for structure IO. TODO: tests for validation of values
+ * TODO: tests for race conditions (all fields are static, is that correct ?)
+ *
+ * @author tcofoegbu
+ *
+ */
public class StructureImportSettings
{
/**
* Set true to predict secondary structure (using JMol for protein, Annotate3D
* for RNA)
*/
- private static boolean predictSecStr = false;
+ private static boolean processSecStr = false;
/**
* Set true (with predictSecondaryStructure=true) to predict secondary
private static boolean showSeqFeatures = true;
- private static boolean processHETATMs = false;
+ public enum StructureParser
+ {
+ JMOL_PARSER, JALVIEW_PARSER
+ }
+
- private static String currentDefaultFormat = DBRefSource.PDB;
+ /**
+ * Determines the default file format for structure files to be downloaded
+ * from the PDB sequence fetcher. Possible options include: PDB|mmCIF
+ */
+ private static PDBEntry.Type defaultStructureFileFormat = Type.PDB;
+ /**
+ * Determines the parser used for parsing PDB format file. Possible options
+ * are : JMolParser|JalveiwParser
+ */
+ private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER;
public static void addSettings(boolean addAlignmentAnnotations,
- boolean predictSecStr, boolean externalSecStr)
+ boolean processSecStr, boolean externalSecStr)
{
StructureImportSettings.visibleChainAnnotation = addAlignmentAnnotations;
- StructureImportSettings.predictSecStr = predictSecStr;
+ StructureImportSettings.processSecStr = processSecStr;
StructureImportSettings.externalSecondaryStructure = externalSecStr;
StructureImportSettings.showSeqFeatures = true;
}
StructureImportSettings.visibleChainAnnotation = visibleChainAnnotation;
}
- public static boolean isPredictSecondaryStructure()
+ public static boolean isProcessSecondaryStructure()
{
- return predictSecStr;
+ return processSecStr;
}
- public static void setPredictSecondaryStructure(
- boolean predictSecondaryStructure)
+ public static void setProcessSecondaryStructure(
+ boolean processSecondaryStructure)
{
- StructureImportSettings.predictSecStr = predictSecondaryStructure;
+ StructureImportSettings.processSecStr = processSecondaryStructure;
}
public static boolean isExternalSecondaryStructure()
StructureImportSettings.showSeqFeatures = showSeqFeatures;
}
- public static String getCurrentDefaultFormat()
+ public static PDBEntry.Type getDefaultStructureFileFormat()
+ {
+ return defaultStructureFileFormat;
+ }
+
+ public static void setDefaultStructureFileFormat(
+ String defaultStructureFileFormat)
{
- return currentDefaultFormat;
+ StructureImportSettings.defaultStructureFileFormat = PDBEntry.Type
+ .valueOf(defaultStructureFileFormat.toUpperCase());
}
- public static void setCurrentDefaultFormat(String currentDefaultFormat)
+ public static String getDefaultPDBFileParser()
{
- StructureImportSettings.currentDefaultFormat = currentDefaultFormat;
+ return defaultPDBFileParser.toString();
}
- public static boolean isProcessHETATMs()
+ public static void setDefaultPDBFileParser(
+ StructureParser defaultPDBFileParser)
{
- return processHETATMs;
+ StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser;
}
- public static void setProcessHETATMs(boolean processHETATMs)
+ public static void setDefaultPDBFileParser(String defaultPDBFileParser)
{
- StructureImportSettings.processHETATMs = processHETATMs;
+ StructureImportSettings.defaultPDBFileParser = StructureParser
+ .valueOf(defaultPDBFileParser.toUpperCase());
}
}