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