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/** 025 * A simple bean that contains the parameters that can get set at startup 026 * 027 * @author Andreas Prlic 028 */ 029public class StartupParameters { 030 031 String pdbFilePath; 032 String cacheFilePath; 033 String outFile; 034 String pdb1; 035 String pdb2; 036 String file1; 037 String file2; 038 String showDBresult; 039 boolean printXML; 040 boolean printFatCat; 041 boolean show3d; 042 boolean autoFetch; 043 boolean printCE; 044 boolean showMenu; 045 boolean printPDB; 046 boolean isDomainSplit; 047 048 049 // for DB searches 050 String alignPairs; 051 String saveOutputDir; 052 int nrCPU; 053 054 055 private static final String newline = System.getProperty("line.separator"); 056 057 public StartupParameters(){ 058 show3d = false; 059 printXML = false; 060 printPDB = false; 061 printFatCat = false; 062 autoFetch = false; 063 showMenu = false; 064 isDomainSplit = true; 065 nrCPU = Runtime.getRuntime().availableProcessors() -1; 066 if ( nrCPU < 1) 067 nrCPU = 1; 068 } 069 070 /** 071 * The file that contains a list of PDB pairs to be aligned 072 * 073 * @return 074 */ 075 public String getAlignPairs() { 076 return alignPairs; 077 } 078 079 public void setAlignPairs(String alignPairs) { 080 this.alignPairs = alignPairs; 081 } 082 083 public String getSaveOutputDir() { 084 return saveOutputDir; 085 } 086 087 public void setSaveOutputDir(String saveOutputDir) { 088 this.saveOutputDir = saveOutputDir; 089 } 090 091 public boolean isShowMenu() { 092 return showMenu; 093 } 094 095 public void setShowMenu(boolean showMenu) { 096 this.showMenu = showMenu; 097 } 098 099 /** 100 * Display the output string in CE style 101 * 102 * @return flag 103 */ 104 public boolean isPrintCE() { 105 return printCE; 106 } 107 108 /** 109 * Display the output string in CE style 110 * 111 * @param printCE a flag 112 */ 113 public void setPrintCE(boolean printCE) { 114 this.printCE = printCE; 115 } 116 117 118 public String getPdb1() { 119 return pdb1; 120 } 121 /** 122 * mandatory argument to set the first PDB (and optionally chain ID) to be aligned. 123 * 124 * @param pdb1 125 */ 126 public void setPdb1(String pdb1) { 127 this.pdb1 = pdb1; 128 } 129 public String getPdb2() { 130 return pdb2; 131 } 132 133 /** 134 * mandatory argument to set the second PDB (and optionally chain ID) to be aligned. 135 * @param pdb2 136 */ 137 public void setPdb2(String pdb2) { 138 this.pdb2 = pdb2; 139 } 140 141 public boolean isPrintXML() { 142 return printXML; 143 } 144 public void setPrintXML(boolean printXML) { 145 this.printXML = printXML; 146 } 147 public boolean isPrintFatCat() { 148 return printFatCat; 149 } 150 public void setPrintFatCat(boolean printFatCat) { 151 this.printFatCat = printFatCat; 152 } 153 154 public String getPdbFilePath() { 155 return pdbFilePath; 156 } 157 158 /** 159 * mandatory argument to set the location of PDB files. 160 * 161 * @param pdbFilePath 162 */ 163 public void setPdbFilePath(String pdbFilePath) { 164 this.pdbFilePath = pdbFilePath; 165 } 166 167 public String getCacheFilePath() { 168 return cacheFilePath; 169 } 170 171 public void setCacheFilePath(String cacheFilePath) { 172 this.cacheFilePath = cacheFilePath; 173 } 174 175 public boolean isShow3d() { 176 return show3d; 177 } 178 public void setShow3d(boolean show3d) { 179 this.show3d = show3d; 180 } 181 public String getOutFile() { 182 return outFile; 183 } 184 public void setOutFile(String outFile) { 185 this.outFile = outFile; 186 } 187 public boolean isAutoFetch() { 188 return autoFetch; 189 } 190 public void setAutoFetch(boolean autoFetch) { 191 this.autoFetch = autoFetch; 192 } 193 public String getShowDBresult() { 194 return showDBresult; 195 } 196 public void setShowDBresult(String showDBresult) { 197 this.showDBresult = showDBresult; 198 } 199 200 public int getNrCPU() { 201 return nrCPU; 202 } 203 public void setNrCPU(int nrCPU) { 204 this.nrCPU = nrCPU; 205 } 206 207 public String getFile1() 208 { 209 return file1; 210 } 211 212 public void setFile1(String file1) 213 { 214 this.file1 = file1; 215 } 216 217 public String getFile2() 218 { 219 return file2; 220 } 221 222 public void setFile2(String file2) 223 { 224 this.file2 = file2; 225 } 226 227 /** 228 * When writing the results to a file, don;t write as XML but write aligned PDB file 229 * 230 * @return flag 231 */ 232 public boolean isOutputPDB() { 233 return printPDB; 234 } 235 /** When writing the results to a file, don;t write as XML but write aligned PDB file 236 * 237 * @param printPDB flag to print aligned PDB 238 */ 239 public void setOutputPDB(boolean printPDB) { 240 this.printPDB = printPDB; 241 } 242 243 public boolean isDomainSplit() { 244 return isDomainSplit; 245 } 246 247 public void setDomainSplit(boolean isDomainSplit) { 248 this.isDomainSplit = isDomainSplit; 249 } 250 251 @Override 252 public String toString() { 253 return "StartupParameters [pdbFilePath=" + pdbFilePath 254 + ", " + newline + " cacheFilePath=" + cacheFilePath + ", " + newline + " outFile=" + outFile 255 + ", " + newline + " pdb1=" + pdb1 + ", " + newline + " pdb2=" + pdb2 + ", " + newline + " file1=" + file1 256 + ", " + newline + " file2=" + file2 + ", " + newline + " showDBresult=" + showDBresult 257 + ", " + newline + " printXML=" + printXML + ", " + newline + " printFatCat=" + printFatCat 258 + ", " + newline + " show3d=" + show3d + ", " + newline + " autoFetch=" + autoFetch 259 + ", " + newline + " printCE=" + printCE + ", " + newline + " showMenu=" + showMenu 260 + ", " + newline + " printPDB=" + printPDB 261 + ", " + newline + " isDomainSplit=" 262 + isDomainSplit + ", " + newline + " alignPairs=" + alignPairs 263 + ", " + newline + " saveOutputDir=" 264 + saveOutputDir + ", " + newline + " nrCPU=" + nrCPU + "]"; 265 } 266 267}