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        public boolean isPrintXML() {
152                return printXML;
153        }
154        public void setPrintXML(boolean printXML) {
155                this.printXML = printXML;
156        }
157        public boolean isPrintFatCat() {
158                return printFatCat;
159        }
160        public void setPrintFatCat(boolean printFatCat) {
161                this.printFatCat = printFatCat;
162        }
163
164        public String getPdbFilePath() {
165                return pdbFilePath;
166        }
167
168        /** mandatory argument to set the location of PDB files.
169         *
170         * @param pdbFilePath
171         */
172        public void setPdbFilePath(String pdbFilePath) {
173                this.pdbFilePath = pdbFilePath;
174        }
175
176        public String getCacheFilePath() {
177                return cacheFilePath;
178        }
179
180        public void setCacheFilePath(String cacheFilePath) {
181                this.cacheFilePath = cacheFilePath;
182        }
183
184        public boolean isShow3d() {
185                return show3d;
186        }
187        public void setShow3d(boolean show3d) {
188                this.show3d = show3d;
189        }
190        public String getOutFile() {
191                return outFile;
192        }
193        public void setOutFile(String outFile) {
194                this.outFile = outFile;
195        }
196        public boolean isAutoFetch() {
197                return autoFetch;
198        }
199        public void setAutoFetch(boolean autoFetch) {
200                this.autoFetch = autoFetch;
201        }
202        public String getShowDBresult() {
203                return showDBresult;
204        }
205        public void setShowDBresult(String showDBresult) {
206                this.showDBresult = showDBresult;
207        }
208
209        public int getNrCPU() {
210                return nrCPU;
211        }
212        public void setNrCPU(int nrCPU) {
213                this.nrCPU = nrCPU;
214        }
215
216        public String getFile1()
217        {
218                return file1;
219        }
220
221        public void setFile1(String file1)
222        {
223                this.file1 = file1;
224        }
225
226        public String getFile2()
227        {
228                return file2;
229        }
230
231        public void setFile2(String file2)
232        {
233                this.file2 = file2;
234        }
235
236
237
238        /** When writing the results to a file, don;t write as XML but write aligned PDB file
239         *
240         * @return flag
241         */
242        public boolean isOutputPDB() {
243                return printPDB;
244        }
245        /** When writing the results to a file, don;t write as XML but write aligned PDB file
246         *
247         * @param printPDB flag to print aligned PDB
248         */
249        public void setOutputPDB(boolean printPDB) {
250                this.printPDB = printPDB;
251        }
252
253
254
255
256
257        public boolean isDomainSplit() {
258                return isDomainSplit;
259        }
260
261        public void setDomainSplit(boolean isDomainSplit) {
262                this.isDomainSplit = isDomainSplit;
263        }
264
265        @Override
266        public String toString() {
267                return "StartupParameters [pdbFilePath=" + pdbFilePath
268                                + ", " + newline + " cacheFilePath=" + cacheFilePath + ", " + newline + " outFile=" + outFile
269                                + ", " + newline + " pdb1=" + pdb1 + ", " + newline + " pdb2=" + pdb2 + ", " + newline + " file1=" + file1
270                                + ", " + newline + " file2=" + file2 + ", " + newline + " showDBresult=" + showDBresult
271                                + ", " + newline + " printXML=" + printXML + ", " + newline + " printFatCat=" + printFatCat
272                                + ", " + newline + " show3d=" + show3d + ", " + newline + " autoFetch=" + autoFetch
273                                + ", " + newline + " printCE=" + printCE + ", " + newline + " showMenu=" + showMenu
274                                + ", " + newline + " printPDB=" + printPDB
275                                + ", " + newline + " isDomainSplit="
276                                + isDomainSplit + ", " + newline + " alignPairs=" + alignPairs
277                                + ", " + newline + " searchFile=" + searchFile + ", " + newline + " saveOutputDir="
278                                + saveOutputDir + ", " + newline + " nrCPU=" + nrCPU + "]";
279        }
280
281
282
283
284
285
286
287}