JAL-2148 fix to heuristically determine chain termination positions. This aids in...
[jalview.git] / src / jalview / structure / StructureImportSettings.java
1 package jalview.structure;
2
3 import jalview.datamodel.DBRefSource;
4
5 public class StructureImportSettings
6 {
7   /**
8    * set to true to add derived sequence annotations (temp factor read from
9    * file, or computed secondary structure) to the alignment
10    */
11   private static boolean visibleChainAnnotation = false;
12
13   /**
14    * Set true to predict secondary structure (using JMol for protein, Annotate3D
15    * for RNA)
16    */
17   private static boolean predictSecStr = false;
18
19   /**
20    * Set true (with predictSecondaryStructure=true) to predict secondary
21    * structure using an external service (currently Annotate3D for RNA only)
22    */
23   private static boolean externalSecondaryStructure = false;
24
25   private static boolean showSeqFeatures = true;
26
27   public static final String JMOL_PARSER = "JMolParser";
28
29   public static final String JALVIEW_PARSER = "JalViewParser";
30
31   public static final String MMCIF = "mmCIF";
32
33   public static final String PDB = "PDB";
34
35   /**
36    * Determines the default file format for structure files to be downloaded
37    * from the PDB sequence fetcher. Possible options include: PDB|mmCIF
38    */
39   private static String defaultStructureFileFormat = DBRefSource.PDB;
40
41   /**
42    * Determines the parser used for parsing PDB format file. Possible options
43    * are : JMolParser|JalveiwParser
44    */
45   private static String defaultPDBFileParser = JMOL_PARSER;
46   public static void addSettings(boolean addAlignmentAnnotations,
47           boolean predictSecStr, boolean externalSecStr)
48   {
49     StructureImportSettings.visibleChainAnnotation = addAlignmentAnnotations;
50     StructureImportSettings.predictSecStr = predictSecStr;
51     StructureImportSettings.externalSecondaryStructure = externalSecStr;
52     StructureImportSettings.showSeqFeatures = true;
53   }
54
55   public static boolean isVisibleChainAnnotation()
56   {
57     return visibleChainAnnotation;
58   }
59
60   public static void setVisibleChainAnnotation(
61           boolean visibleChainAnnotation)
62   {
63     StructureImportSettings.visibleChainAnnotation = visibleChainAnnotation;
64   }
65
66   public static boolean isPredictSecondaryStructure()
67   {
68     return predictSecStr;
69   }
70
71   public static void setPredictSecondaryStructure(
72           boolean predictSecondaryStructure)
73   {
74     StructureImportSettings.predictSecStr = predictSecondaryStructure;
75   }
76
77   public static boolean isExternalSecondaryStructure()
78   {
79     return externalSecondaryStructure;
80   }
81
82   public static void setExternalSecondaryStructure(
83           boolean externalSecondaryStructure)
84   {
85     StructureImportSettings.externalSecondaryStructure = externalSecondaryStructure;
86   }
87
88   public static boolean isShowSeqFeatures()
89   {
90     return showSeqFeatures;
91   }
92
93   public static void setShowSeqFeatures(boolean showSeqFeatures)
94   {
95     StructureImportSettings.showSeqFeatures = showSeqFeatures;
96   }
97
98   public static String getDefaultStructureFileFormat()
99   {
100     return defaultStructureFileFormat;
101   }
102
103   public static void setDefaultStructureFileFormat(
104           String defaultStructureFileFormat)
105   {
106     StructureImportSettings.defaultStructureFileFormat = defaultStructureFileFormat;
107   }
108
109   public static String getDefaultPDBFileParser()
110   {
111     return defaultPDBFileParser;
112   }
113
114   public static void setDefaultPDBFileParser(String defaultPDBFileParser)
115   {
116     StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser;
117   }
118
119 }