Skip to content

Commit e46063d

Browse files
committed
Removing CE-specific parameters from the default CLI
1 parent 9e199d0 commit e46063d

3 files changed

Lines changed: 74 additions & 79 deletions

File tree

biojava3-structure/src/main/java/org/biojava/bio/structure/align/AbstractStructureAlignment.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ public String printHelp() {
5656
buf.append(" -autoFetch true/false if set to true PDB files will automatically get downloaded and stored in the right location. (default: false)").append(newline);
5757
buf.append(" -pdbDirSplit true/false the directory containing PDB files has all PDBs in one level or is split into multiple subdirs, like the ftp site. (default: true)").append(newline);
5858
buf.append(" -showMenu displays the menu that allows to run alignments through a user interface.").append(newline);
59-
buf.append(" -maxGapSize (jCE specific): set the maximum gap size parameter G during AFP extension. default: 30. Set to 0 for unrestricted. ").append(newline);
60-
buf.append(" -showAFPRanges (jCE specific): show the raw Aligned Fragment Pair positions, prior to optimization.").append(newline);
6159
buf.append(newline);
6260

6361
buf.append("--- custom searches ---").append(newline);
@@ -73,20 +71,10 @@ public String printHelp() {
7371
buf.append(" -saveOutputDir (optional) a directory that will contain the detailed outputs of the alignments. By default will write XML files, if used together with -outputPDB, will write PDB files of the alignment.").append(newline);
7472
buf.append(newline);
7573

76-
buf.append(" Once DB seaches are complete it is possible to view the results with:").append(newline);
74+
buf.append(" Once DB seaches are complete it is possible to view the results with:").append(newline);
7775
buf.append(" -showDBresult (optional) path to a DB outFile to show. Also provide the -pdbFilePath parameter to enable visualisation of results.").append(newline);
7876
buf.append(newline);
7977

80-
buf.append(" For boolean arguments: if neither the text >true< or >false< is provided it is assumed to mean >true<. Instead of >-argument false< it is also possible to write -noArgument.").append(newline);
81-
buf.append(newline);
82-
83-
buf.append("--- How to specify what to align ---").append(newline);
84-
buf.append(" If only a PDB code is provided, the whole structure will be used for the alignment.").append(newline);
85-
buf.append(" To specify a particular chain write as: 4hhb.A (chain IDs are case sensitive, PDB ids are not)").append(newline);
86-
buf.append(" To specify that the 1st chain in a structure should be used write: 4hhb:0 .").append(newline);
87-
buf.append(" In order to align SCOP domains, provide pdb1/pdb2 as: d4hhba_ Note: if SCOP is not installed at the -pdbFilePath, will automatically download and install.").append(newline);
88-
buf.append(newline);
89-
9078
ConfigStrucAligParams params = getParameters();
9179
List<String> paramNames = params.getUserConfigParameters();
9280
List<String> paramHelp = params.getUserConfigHelp();
@@ -106,6 +94,17 @@ public String printHelp() {
10694
buf.append(newline);
10795
}
10896
}
97+
buf.append(newline);
98+
99+
buf.append(" For boolean arguments: if neither the text >true< or >false< is provided it is assumed to mean >true<. Instead of >-argument false< it is also possible to write -noArgument.").append(newline);
100+
buf.append(newline);
101+
102+
buf.append("--- How to specify what to align ---").append(newline);
103+
buf.append(" If only a PDB code is provided, the whole structure will be used for the alignment.").append(newline);
104+
buf.append(" To specify a particular chain write as: 4hhb.A (chain IDs are case sensitive, PDB ids are not)").append(newline);
105+
buf.append(" To specify that the 1st chain in a structure should be used write: 4hhb:0 .").append(newline);
106+
buf.append(" In order to align SCOP domains, provide pdb1/pdb2 as: d4hhba_ Note: if SCOP is not installed at the -pdbFilePath, will automatically download and install.").append(newline);
107+
buf.append(newline);
109108

110109
return buf.toString();
111110
}

biojava3-structure/src/main/java/org/biojava/bio/structure/align/ce/CeUserArgumentProcessor.java

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@
3535
public class CeUserArgumentProcessor extends AbstractUserArgumentProcessor {
3636

3737
protected class CeStartupParams extends StartupParameters {
38-
//protected int maxGapSize; //TODO move from superclass
38+
protected int maxGapSize;
3939
protected int winSize;
4040
protected int scoringStrategy;
41-
//protected double maxOptRMSD; //TODO
41+
protected double maxOptRMSD;
4242
protected double gapOpen;
4343
protected double gapExtension;
44-
//protected boolean showAFPRanges; //TODO
44+
protected boolean showAFPRanges;
4545

4646
public CeStartupParams() {
4747
super();
48-
//maxGapSize = 30;
48+
maxGapSize = 30;
4949
winSize = 8;
5050
scoringStrategy = CeParameters.DEFAULT_SCORING_STRATEGY;
51-
//showAFPRanges = false;
52-
//maxOptRMSD = 99d;
51+
showAFPRanges = false;
52+
maxOptRMSD = 99d;
5353
gapOpen = CeParameters.DEFAULT_GAP_OPEN;
5454
gapExtension = CeParameters.DEFAULT_GAP_EXTENSION;
5555
}
@@ -86,13 +86,59 @@ public void setGapExtension(double gapExtension) {
8686
this.gapExtension = gapExtension;
8787
}
8888

89+
/** CE specific parameter: set the Max gap size parameter G (during AFP extension). Default: 30
90+
*
91+
* @return the maximum gap size G parameter.
92+
*/
93+
public int getMaxGapSize() {
94+
return maxGapSize;
95+
}
96+
97+
/** CE specific parameter: set the Max gap size parameter G (during AFP extension). Default: 30
98+
*
99+
* @param maxGapSize
100+
*/
101+
public void setMaxGapSize(int maxGapSize) {
102+
this.maxGapSize = maxGapSize;
103+
}
104+
105+
public boolean isShowAFPRanges()
106+
{
107+
return showAFPRanges;
108+
}
109+
110+
public void setShowAFPRanges(boolean showAFP)
111+
{
112+
this.showAFPRanges = showAFP;
113+
}
114+
115+
116+
/**(jCE specific): maximum RMSD that shall be calculated for the alignment.
117+
*
118+
* @return maxOptRMSD parameter
119+
*/
120+
public Double getMaxOptRMSD() {
121+
return maxOptRMSD;
122+
}
123+
124+
/** (jCE specific): maximum RMSD that shall be calculated for the alignment.
125+
*
126+
* @param maxOptRMSD max RMSD to calculate
127+
*/
128+
public void setMaxOptRMSD(Double maxOptRMSD) {
129+
this.maxOptRMSD = maxOptRMSD;
130+
}
131+
89132
@Override
90133
public String toString() {
91134
StringBuilder builder = new StringBuilder();
92-
builder.append("CeStartupParams [winSize=").append(winSize)
135+
builder.append("CeStartupParams [maxGapSize=").append(maxGapSize)
136+
.append(", winSize=").append(winSize)
93137
.append(", scoringStrategy=").append(scoringStrategy)
138+
.append(", maxOptRMSD=").append(maxOptRMSD)
94139
.append(", gapOpen=").append(gapOpen)
95140
.append(", gapExtension=").append(gapExtension)
141+
.append(", showAFPRanges=").append(showAFPRanges)
96142
.append(", pdbFilePath=").append(pdbFilePath)
97143
.append(", cacheFilePath=").append(cacheFilePath)
98144
.append(", outFile=").append(outFile).append(", pdb1=")
@@ -106,15 +152,12 @@ public String toString() {
106152
.append(", flexible=").append(flexible)
107153
.append(", pdbDirSplit=").append(pdbDirSplit)
108154
.append(", printCE=").append(printCE).append(", showMenu=")
109-
.append(showMenu).append(", showAFPRanges=")
110-
.append(showAFPRanges).append(", printPDB=")
111-
.append(printPDB).append(", maxOptRMSD=")
112-
.append(maxOptRMSD).append(", isDomainSplit=")
113-
.append(isDomainSplit).append(", alignPairs=")
114-
.append(alignPairs).append(", searchFile=")
115-
.append(searchFile).append(", saveOutputDir=")
116-
.append(saveOutputDir).append(", nrCPU=").append(nrCPU)
117-
.append(", maxGapSize=").append(maxGapSize).append("]");
155+
.append(showMenu).append(", printPDB=").append(printPDB)
156+
.append(", isDomainSplit=").append(isDomainSplit)
157+
.append(", alignPairs=").append(alignPairs)
158+
.append(", searchFile=").append(searchFile)
159+
.append(", saveOutputDir=").append(saveOutputDir)
160+
.append(", nrCPU=").append(nrCPU).append("]");
118161
return builder.toString();
119162
}
120163

biojava3-structure/src/main/java/org/biojava/bio/structure/align/ce/StartupParameters.java

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ public class StartupParameters {
2626
boolean pdbDirSplit;
2727
boolean printCE;
2828
boolean showMenu;
29-
boolean showAFPRanges;
3029
boolean printPDB;
31-
Double maxOptRMSD;
3230
boolean isDomainSplit;
3331

3432

@@ -38,7 +36,6 @@ public class StartupParameters {
3836
String saveOutputDir;
3937
int nrCPU;
4038

41-
int maxGapSize;
4239

4340
private static final String newline = System.getProperty("line.separator");
4441

@@ -50,10 +47,7 @@ public StartupParameters(){
5047
autoFetch = false;
5148
flexible = false;
5249
pdbDirSplit = true;
53-
maxGapSize = 30;
54-
showAFPRanges = false;
5550
showMenu = false;
56-
maxOptRMSD = 99d;
5751
isDomainSplit = true;
5852
nrCPU = Runtime.getRuntime().availableProcessors() -1;
5953
if ( nrCPU < 1)
@@ -218,22 +212,6 @@ public void setNrCPU(int nrCPU) {
218212
this.nrCPU = nrCPU;
219213
}
220214

221-
/** CE specific parameter: set the Max gap size parameter G (during AFP extension). Default: 30
222-
*
223-
* @return the maximum gap size G parameter.
224-
*/
225-
public int getMaxGapSize() {
226-
return maxGapSize;
227-
}
228-
229-
/** CE specific parameter: set the Max gap size parameter G (during AFP extension). Default: 30
230-
*
231-
* @param maxGapSize
232-
*/
233-
public void setMaxGapSize(int maxGapSize) {
234-
this.maxGapSize = maxGapSize;
235-
}
236-
237215
public String getFile1()
238216
{
239217
return file1;
@@ -255,15 +233,6 @@ public void setFile2(String file2)
255233
}
256234

257235

258-
public boolean isShowAFPRanges()
259-
{
260-
return showAFPRanges;
261-
}
262-
263-
public void setShowAFPRanges(boolean showAFP)
264-
{
265-
this.showAFPRanges = showAFP;
266-
}
267236

268237
/** When writing the results to a file, don;t write as XML but write aligned PDB file
269238
*
@@ -281,21 +250,6 @@ public void setOutputPDB(boolean printPDB) {
281250
}
282251

283252

284-
/**(jCE specific): maximum RMSD that shall be calculated for the alignment.
285-
*
286-
* @return maxOptRMSD parameter
287-
*/
288-
public Double getMaxOptRMSD() {
289-
return maxOptRMSD;
290-
}
291-
292-
/** (jCE specific): maximum RMSD that shall be calculated for the alignment.
293-
*
294-
* @param maxOptRMSD max RMSD to calculate
295-
*/
296-
public void setMaxOptRMSD(Double maxOptRMSD) {
297-
this.maxOptRMSD = maxOptRMSD;
298-
}
299253

300254

301255

@@ -317,12 +271,11 @@ public String toString() {
317271
+ ", " + newline + " show3d=" + show3d + ", " + newline + " autoFetch=" + autoFetch
318272
+ ", " + newline + " flexible=" + flexible + ", " + newline + " pdbDirSplit=" + pdbDirSplit
319273
+ ", " + newline + " printCE=" + printCE + ", " + newline + " showMenu=" + showMenu
320-
+ ", " + newline + " showAFPRanges=" + showAFPRanges + ", " + newline + " printPDB=" + printPDB
321-
+ ", " + newline + " maxOptRMSD=" + maxOptRMSD + ", " + newline + " isDomainSplit="
274+
+ ", " + newline + " printPDB=" + printPDB
275+
+ ", " + newline + " isDomainSplit="
322276
+ isDomainSplit + ", " + newline + " alignPairs=" + alignPairs
323277
+ ", " + newline + " searchFile=" + searchFile + ", " + newline + " saveOutputDir="
324-
+ saveOutputDir + ", " + newline + " nrCPU=" + nrCPU + ", " + newline + " maxGapSize="
325-
+ maxGapSize + "]";
278+
+ saveOutputDir + ", " + newline + " nrCPU=" + nrCPU + "]";
326279
}
327280

328281

0 commit comments

Comments
 (0)