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 jalview.datamodel.PDBEntry;
24 import jalview.datamodel.PDBEntry.Type;
27 * bean holding settings for structure IO. TODO: tests for validation of values
28 * TODO: tests for race conditions (all fields are static, is that correct ?)
33 public class StructureImportSettings
36 * set to true to add derived sequence annotations (temp factor read from
37 * file, or computed secondary structure) to the alignment
39 private static boolean visibleChainAnnotation = false;
42 * Set true to predict secondary structure (using JMol for protein, Annotate3D
45 private static boolean processSecStr = false;
48 * Set true (with predictSecondaryStructure=true) to predict secondary
49 * structure using an external service (currently Annotate3D for RNA only)
51 private static boolean externalSecondaryStructure = false;
53 private static boolean showSeqFeatures = true;
55 public enum StructureParser
57 JMOL_PARSER, JALVIEW_PARSER
61 * Determines the default file format for structure files to be downloaded
62 * from the PDB sequence fetcher. Possible options include: PDB|mmCIF
64 private static PDBEntry.Type defaultStructureFileFormat = Type.PDB;
67 * Determines the parser used for parsing PDB format file. Possible options
68 * are : JMolParser|JalveiwParser
70 private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER;
72 public static void addSettings(boolean addAlignmentAnnotations,
73 boolean processSecStr, boolean externalSecStr)
75 StructureImportSettings.visibleChainAnnotation = addAlignmentAnnotations;
76 StructureImportSettings.processSecStr = processSecStr;
77 StructureImportSettings.externalSecondaryStructure = externalSecStr;
78 StructureImportSettings.showSeqFeatures = true;
81 public static boolean isVisibleChainAnnotation()
83 return visibleChainAnnotation;
86 public static void setVisibleChainAnnotation(
87 boolean visibleChainAnnotation)
89 StructureImportSettings.visibleChainAnnotation = visibleChainAnnotation;
92 public static boolean isProcessSecondaryStructure()
97 public static void setProcessSecondaryStructure(
98 boolean processSecondaryStructure)
100 StructureImportSettings.processSecStr = processSecondaryStructure;
103 public static boolean isExternalSecondaryStructure()
105 return externalSecondaryStructure;
108 public static void setExternalSecondaryStructure(
109 boolean externalSecondaryStructure)
111 StructureImportSettings.externalSecondaryStructure = externalSecondaryStructure;
114 public static boolean isShowSeqFeatures()
116 return showSeqFeatures;
119 public static void setShowSeqFeatures(boolean showSeqFeatures)
121 StructureImportSettings.showSeqFeatures = showSeqFeatures;
124 public static String getDefaultStructureFileFormat()
126 return defaultStructureFileFormat.toString();
129 public static void setDefaultStructureFileFormat(
130 String defaultStructureFileFormat)
132 StructureImportSettings.defaultStructureFileFormat = PDBEntry.Type
133 .valueOf(defaultStructureFileFormat.toUpperCase());
136 public static String getDefaultPDBFileParser()
138 return defaultPDBFileParser.toString();
141 public static void setDefaultPDBFileParser(
142 StructureParser defaultPDBFileParser)
144 StructureImportSettings.defaultPDBFileParser = defaultPDBFileParser;
147 public static void setDefaultPDBFileParser(String defaultPDBFileParser)
149 StructureImportSettings.defaultPDBFileParser = StructureParser
150 .valueOf(defaultPDBFileParser.toUpperCase());