001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021package org.biojava.nbio.structure.align.ce; 022 023 024/** a simple bean that contains the parameters that can get set at startup 025 * 026 * @author Andreas Prlic 027 * 028 */ 029public class StartupParameters { 030 031 032 033 String pdbFilePath; 034 String cacheFilePath; 035 String outFile; 036 String pdb1; 037 String pdb2; 038 String file1; 039 String file2; 040 String showDBresult; 041 boolean printXML; 042 boolean printFatCat; 043 boolean show3d; 044 boolean autoFetch; 045 boolean printCE; 046 boolean showMenu; 047 boolean printPDB; 048 boolean isDomainSplit; 049 050 051 // for DB searches 052 String alignPairs; 053 String searchFile; 054 String saveOutputDir; 055 int nrCPU; 056 057 058 private static final String newline = System.getProperty("line.separator"); 059 060 public StartupParameters(){ 061 show3d = false; 062 printXML = false; 063 printPDB = false; 064 printFatCat = false; 065 autoFetch = false; 066 showMenu = false; 067 isDomainSplit = true; 068 nrCPU = Runtime.getRuntime().availableProcessors() -1; 069 if ( nrCPU < 1) 070 nrCPU = 1; 071 } 072 073 /** An input file to be used for the DB search 074 * 075 * @return 076 */ 077 public String getSearchFile() { 078 return searchFile; 079 } 080 public void setSearchFile(String searchFile) { 081 this.searchFile = searchFile; 082 } 083 084 085 /** The file that contains a list of PDB pairs to be aligned 086 * 087 * @return 088 */ 089 public String getAlignPairs() { 090 return alignPairs; 091 } 092 093 public void setAlignPairs(String alignPairs) { 094 this.alignPairs = alignPairs; 095 } 096 097 public String getSaveOutputDir() { 098 return saveOutputDir; 099 } 100 101 public void setSaveOutputDir(String saveOutputDir) { 102 this.saveOutputDir = saveOutputDir; 103 } 104 105 public boolean isShowMenu() { 106 return showMenu; 107 } 108 109 public void setShowMenu(boolean showMenu) { 110 this.showMenu = showMenu; 111 } 112 113 /** Display the output string in CE style 114 * 115 * @return flag 116 */ 117 public boolean isPrintCE() { 118 return printCE; 119 } 120 121 /** Display the output string in CE style 122 * 123 * @param printCE a flag 124 */ 125 public void setPrintCE(boolean printCE) { 126 this.printCE = printCE; 127 } 128 129 130 public String getPdb1() { 131 return pdb1; 132 } 133 /** mandatory argument to set the first PDB (and optionally chain ID) to be aligned. 134 * 135 * @param pdb1 136 */ 137 public void setPdb1(String pdb1) { 138 this.pdb1 = pdb1; 139 } 140 public String getPdb2() { 141 return pdb2; 142 } 143 144 /** mandatory argument to set the second PDB (and optionally chain ID) to be aligned. 145 * @param pdb2 146 */ 147 public void setPdb2(String pdb2) { 148 this.pdb2 = pdb2; 149 } 150 151 /** 152 * @return true 153 * @deprecated Always returns true (4.0.0) 154 */ 155 @Deprecated 156 public boolean isPdbDirSplit() { 157 return true; 158 } 159 /** 160 * @param pdbDirSplit Ignored 161 * @deprecated Ignored (4.0.0) 162 */ 163 @Deprecated 164 public void setPdbDirSplit(boolean pdbDirSplit) {} 165 166 public boolean isPrintXML() { 167 return printXML; 168 } 169 public void setPrintXML(boolean printXML) { 170 this.printXML = printXML; 171 } 172 public boolean isPrintFatCat() { 173 return printFatCat; 174 } 175 public void setPrintFatCat(boolean printFatCat) { 176 this.printFatCat = printFatCat; 177 } 178 179 public String getPdbFilePath() { 180 return pdbFilePath; 181 } 182 183 /** mandatory argument to set the location of PDB files. 184 * 185 * @param pdbFilePath 186 */ 187 public void setPdbFilePath(String pdbFilePath) { 188 this.pdbFilePath = pdbFilePath; 189 } 190 191 public String getCacheFilePath() { 192 return cacheFilePath; 193 } 194 195 public void setCacheFilePath(String cacheFilePath) { 196 this.cacheFilePath = cacheFilePath; 197 } 198 199 public boolean isShow3d() { 200 return show3d; 201 } 202 public void setShow3d(boolean show3d) { 203 this.show3d = show3d; 204 } 205 public String getOutFile() { 206 return outFile; 207 } 208 public void setOutFile(String outFile) { 209 this.outFile = outFile; 210 } 211 public boolean isAutoFetch() { 212 return autoFetch; 213 } 214 public void setAutoFetch(boolean autoFetch) { 215 this.autoFetch = autoFetch; 216 } 217 public String getShowDBresult() { 218 return showDBresult; 219 } 220 public void setShowDBresult(String showDBresult) { 221 this.showDBresult = showDBresult; 222 } 223 224 public int getNrCPU() { 225 return nrCPU; 226 } 227 public void setNrCPU(int nrCPU) { 228 this.nrCPU = nrCPU; 229 } 230 231 public String getFile1() 232 { 233 return file1; 234 } 235 236 public void setFile1(String file1) 237 { 238 this.file1 = file1; 239 } 240 241 public String getFile2() 242 { 243 return file2; 244 } 245 246 public void setFile2(String file2) 247 { 248 this.file2 = file2; 249 } 250 251 252 253 /** When writing the results to a file, don;t write as XML but write aligned PDB file 254 * 255 * @return flag 256 */ 257 public boolean isOutputPDB() { 258 return printPDB; 259 } 260 /** When writing the results to a file, don;t write as XML but write aligned PDB file 261 * 262 * @param printPDB flag to print aligned PDB 263 */ 264 public void setOutputPDB(boolean printPDB) { 265 this.printPDB = printPDB; 266 } 267 268 269 270 271 272 public boolean isDomainSplit() { 273 return isDomainSplit; 274 } 275 276 public void setDomainSplit(boolean isDomainSplit) { 277 this.isDomainSplit = isDomainSplit; 278 } 279 280 @Override 281 public String toString() { 282 return "StartupParameters [pdbFilePath=" + pdbFilePath 283 + ", " + newline + " cacheFilePath=" + cacheFilePath + ", " + newline + " outFile=" + outFile 284 + ", " + newline + " pdb1=" + pdb1 + ", " + newline + " pdb2=" + pdb2 + ", " + newline + " file1=" + file1 285 + ", " + newline + " file2=" + file2 + ", " + newline + " showDBresult=" + showDBresult 286 + ", " + newline + " printXML=" + printXML + ", " + newline + " printFatCat=" + printFatCat 287 + ", " + newline + " show3d=" + show3d + ", " + newline + " autoFetch=" + autoFetch 288 + ", " + newline + " printCE=" + printCE + ", " + newline + " showMenu=" + showMenu 289 + ", " + newline + " printPDB=" + printPDB 290 + ", " + newline + " isDomainSplit=" 291 + isDomainSplit + ", " + newline + " alignPairs=" + alignPairs 292 + ", " + newline + " searchFile=" + searchFile + ", " + newline + " saveOutputDir=" 293 + saveOutputDir + ", " + newline + " nrCPU=" + nrCPU + "]"; 294 } 295 296 297 298 299 300 301 302}