2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.structure;
23 import java.util.Locale;
25 import jalview.datamodel.PDBEntry;
26 import jalview.datamodel.PDBEntry.Type;
29 * bean holding settings for structure IO. TODO: tests for validation of values
30 * TODO: tests for race conditions (all fields are static, is that correct ?)
35 public class StructureImportSettings
38 * set to true to add derived sequence annotations (temp factor read from
39 * file, or computed secondary structure) to the alignment
41 private static boolean visibleChainAnnotation = false;
44 * Set true to predict secondary structure (using JMol for protein, Annotate3D
47 private static boolean processSecStr = false;
50 * Set true (with predictSecondaryStructure=true) to predict secondary
51 * structure using an external service (currently Annotate3D for RNA only)
53 private static boolean externalSecondaryStructure = false;
55 private static boolean showSeqFeatures = true;
57 public enum StructureParser
59 JMOL_PARSER, JALVIEW_PARSER
62 public static enum TFType
68 * Determines the default file format for structure files to be downloaded
69 * from the PDB sequence fetcher. Possible options include: PDB|mmCIF
71 private static PDBEntry.Type defaultStructureFileFormat = Type.PDB;
74 * Determines the parser used for parsing PDB format file. Possible options
75 * are : JMolParser|JalveiwParser
77 private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER;
79 private static TFType temperatureFactorType;
81 public static void addSettings(boolean addAlignmentAnnotations,
82 boolean processSecStr, boolean externalSecStr)
84 StructureImportSettings.visibleChainAnnotation = addAlignmentAnnotations;
85 StructureImportSettings.processSecStr = processSecStr;
86 StructureImportSettings.externalSecondaryStructure = externalSecStr;
87 StructureImportSettings.showSeqFeatures = true;
90 public static boolean isVisibleChainAnnotation()
92 return visibleChainAnnotation;
95 public static void setTemperatureFactorType(TFType t)
97 StructureImportSettings.temperatureFactorType = t;
100 public static void setVisibleChainAnnotation(
101 boolean visibleChainAnnotation)
103 StructureImportSettings.visibleChainAnnotation = visibleChainAnnotation;
106 public static boolean isProcessSecondaryStructure()
108 return processSecStr;
111 public static void setProcessSecondaryStructure(
112 boolean processSecondaryStructure)
114 StructureImportSettings.processSecStr = processSecondaryStructure;
117 public static boolean isExternalSecondaryStructure()
119 return externalSecondaryStructure;
122 public static void setExternalSecondaryStructure(
123 boolean externalSecondaryStructure)
125 StructureImportSettings.externalSecondaryStructure = externalSecondaryStructure;
128 public static boolean isShowSeqFeatures()
130 return showSeqFeatures;
133 public static void setShowSeqFeatures(boolean showSeqFeatures)
135 StructureImportSettings.showSeqFeatures = showSeqFeatures;
138 public static PDBEntry.Type getDefaultStructureFileFormat()
140 return defaultStructureFileFormat;
143 public static void setDefaultStructureFileFormat(
144 String defaultStructureFileFormat)
146 StructureImportSettings.defaultStructureFileFormat = PDBEntry.Type
147 .valueOf(defaultStructureFileFormat.toUpperCase(Locale.ROOT));
150 public static String getDefaultPDBFileParser()
152 return defaultPDBFileParser.toString();
155 public static void setDefaultPDBFileParser(
156 StructureParser defaultPDBFileParser)
158 StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser;
161 public static void setDefaultPDBFileParser(String defaultPDBFileParser)
163 StructureImportSettings.defaultPDBFileParser = StructureParser
164 .valueOf(defaultPDBFileParser.toUpperCase(Locale.ROOT));
167 public static TFType getTemperatureFactorType()
169 return temperatureFactorType;