1 package jalview.structure;
3 import jalview.datamodel.PDBEntry;
4 import jalview.datamodel.PDBEntry.Type;
7 * bean holding settings for structure IO. TODO: tests for validation of values
8 * TODO: tests for race conditions (all fields are static, is that correct ?)
13 public class StructureImportSettings
16 * set to true to add derived sequence annotations (temp factor read from
17 * file, or computed secondary structure) to the alignment
19 private static boolean visibleChainAnnotation = false;
22 * Set true to predict secondary structure (using JMol for protein, Annotate3D
25 private static boolean processSecStr = false;
28 * Set true (with predictSecondaryStructure=true) to predict secondary
29 * structure using an external service (currently Annotate3D for RNA only)
31 private static boolean externalSecondaryStructure = false;
33 private static boolean showSeqFeatures = true;
35 public enum StructureParser
37 JMOL_PARSER, JALVIEW_PARSER
42 * Determines the default file format for structure files to be downloaded
43 * from the PDB sequence fetcher. Possible options include: PDB|mmCIF
45 private static PDBEntry.Type defaultStructureFileFormat = Type.PDB;
48 * Determines the parser used for parsing PDB format file. Possible options
49 * are : JMolParser|JalveiwParser
51 private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER;
52 public static void addSettings(boolean addAlignmentAnnotations,
53 boolean processSecStr, boolean externalSecStr)
55 StructureImportSettings.visibleChainAnnotation = addAlignmentAnnotations;
56 StructureImportSettings.processSecStr = processSecStr;
57 StructureImportSettings.externalSecondaryStructure = externalSecStr;
58 StructureImportSettings.showSeqFeatures = true;
61 public static boolean isVisibleChainAnnotation()
63 return visibleChainAnnotation;
66 public static void setVisibleChainAnnotation(
67 boolean visibleChainAnnotation)
69 StructureImportSettings.visibleChainAnnotation = visibleChainAnnotation;
72 public static boolean isProcessSecondaryStructure()
77 public static void setProcessSecondaryStructure(
78 boolean processSecondaryStructure)
80 StructureImportSettings.processSecStr = processSecondaryStructure;
83 public static boolean isExternalSecondaryStructure()
85 return externalSecondaryStructure;
88 public static void setExternalSecondaryStructure(
89 boolean externalSecondaryStructure)
91 StructureImportSettings.externalSecondaryStructure = externalSecondaryStructure;
94 public static boolean isShowSeqFeatures()
96 return showSeqFeatures;
99 public static void setShowSeqFeatures(boolean showSeqFeatures)
101 StructureImportSettings.showSeqFeatures = showSeqFeatures;
104 public static String getDefaultStructureFileFormat()
106 return defaultStructureFileFormat.toString();
109 public static void setDefaultStructureFileFormat(
110 String defaultStructureFileFormat)
112 StructureImportSettings.defaultStructureFileFormat = PDBEntry.Type
113 .valueOf(defaultStructureFileFormat.toUpperCase());
116 public static String getDefaultPDBFileParser()
118 return defaultPDBFileParser.toString();
121 public static void setDefaultPDBFileParser(
122 StructureParser defaultPDBFileParser)
124 StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser;
127 public static void setDefaultPDBFileParser(String defaultPDBFileParser)
129 StructureImportSettings.defaultPDBFileParser = StructureParser
130 .valueOf(defaultPDBFileParser.toUpperCase());