Skip to content

Commit 46f017c

Browse files
committed
Some code grooming
1 parent 60043c2 commit 46f017c

File tree

12 files changed

+35
-44
lines changed

12 files changed

+35
-44
lines changed

src/main/groovy/com/antigenomics/vdjtools/VdjTools.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,18 @@ else {
166166
} catch (Exception e) {
167167
println "[ERROR] $e.message, see _vdjtools_error.log for details"
168168
new File("_vdjtools_error.log").withWriterAppend { writer ->
169-
writer.println("[${new Date()}]")
169+
writer.println("[${new Date()} BEGIN]")
170170
writer.println("[Script]")
171171
writer.println(args[0])
172172
writer.println("[CommandLine]")
173173
writer.println("executing vdjtools-${version}.jar ${args.join(" ")}")
174174
writer.println("[Message]")
175-
writer.println(e.message)
175+
writer.println(e.toString())
176176
writer.println("[StackTrace-Short]")
177177
writer.println(e.stackTrace.findAll { it.toString().contains("com.antigenomics.vdjtools") }.join("\n"))
178178
writer.println("[StackTrace-Full]")
179179
e.printStackTrace(new PrintWriter(writer))
180+
writer.println("[END]")
180181
}
181182
System.exit(-1)
182183
}

src/main/groovy/com/antigenomics/vdjtools/basic/CalcBasicStats.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
*/
1616

1717

18-
1918
package com.antigenomics.vdjtools.basic
2019

21-
import com.antigenomics.vdjtools.Software
2220
import com.antigenomics.vdjtools.sample.Sample
2321
import com.antigenomics.vdjtools.sample.SampleCollection
2422
import com.antigenomics.vdjtools.sample.metadata.MetadataTable

src/main/groovy/com/antigenomics/vdjtools/basic/CalcSegmentUsage.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.antigenomics.vdjtools.basic
1818

19-
import com.antigenomics.vdjtools.Software
2019
import com.antigenomics.vdjtools.sample.SampleCollection
2120
import com.antigenomics.vdjtools.sample.metadata.MetadataTable
2221
import com.antigenomics.vdjtools.util.RUtil
@@ -84,8 +83,8 @@ println "[${new Date()} $scriptName] ${sampleCollection.size()} samples loaded"
8483

8584
def segmentUsage = new SegmentUsage(sampleCollection, unweighted)
8685

87-
def outputPathV = formOutputPath(outputFilePrefix, "segments", unweighted ? "unwt" : "wt" ,"V"),
88-
outputPathJ = formOutputPath(outputFilePrefix, "segments", unweighted ? "unwt" : "wt" ,"J")
86+
def outputPathV = formOutputPath(outputFilePrefix, "segments", unweighted ? "unwt" : "wt", "V"),
87+
outputPathJ = formOutputPath(outputFilePrefix, "segments", unweighted ? "unwt" : "wt", "J")
8988
new File(outputPathV).withPrintWriter { pwV ->
9089
new File(outputPathJ).withPrintWriter { pwJ ->
9190
def header = "#$MetadataTable.SAMPLE_ID_COLUMN\t" + sampleCollection.metadataTable.columnHeader

src/main/groovy/com/antigenomics/vdjtools/basic/CalcSpectratype.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.antigenomics.vdjtools.basic
1818

19-
import com.antigenomics.vdjtools.Software
2019
import com.antigenomics.vdjtools.sample.Sample
2120
import com.antigenomics.vdjtools.sample.SampleCollection
2221
import com.antigenomics.vdjtools.sample.metadata.MetadataTable

src/main/groovy/com/antigenomics/vdjtools/basic/SegmentUsage.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import com.antigenomics.vdjtools.util.ExecUtil
2525
* Class that represents Variable and Joining segment frequency (usage) vector and V-J pairing matrix
2626
*/
2727
public class SegmentUsage {
28-
//This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
2928
public static boolean VERBOSE = true
3029

3130
private final Map<String, double[]> vSegmentUsage = new HashMap<>(),

src/main/groovy/com/antigenomics/vdjtools/imgt/ImgtParser.groovy

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
/**
2-
Copyright 2014 Mikhail Shugay (mikhail.shugay@gmail.com)
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
1+
/*
2+
* Copyright 2013-2015 Mikhail Shugay (mikhail.shugay@gmail.com)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
1515
*/
1616

1717

src/main/groovy/com/antigenomics/vdjtools/imgt/Test.groovy

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
/**
2-
Copyright 2014 Mikhail Shugay (mikhail.shugay@gmail.com)
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
1+
/*
2+
* Copyright 2013-2015 Mikhail Shugay (mikhail.shugay@gmail.com)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
1515
*/
1616

1717
package com.antigenomics.vdjtools.imgt

src/main/groovy/com/antigenomics/vdjtools/operate/PoolSamples.groovy

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
// todo: UNTESTED
18-
1917
package com.antigenomics.vdjtools.operate
2018

2119
import com.antigenomics.vdjtools.Software

src/main/groovy/com/antigenomics/vdjtools/overlap/Overlap.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import com.antigenomics.vdjtools.util.ExecUtil
2929
* computes a set of overlap metrics
3030
*/
3131
public class Overlap {
32-
//This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
3332
public static boolean VERBOSE = true
3433

3534
private final SamplePair samplePair

src/main/groovy/com/antigenomics/vdjtools/overlap/OverlapEvaluator.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import static com.antigenomics.vdjtools.overlap.OverlapMetric.*
3131
* A helper class to compute various overlap metrics for joint overlap
3232
*/
3333
class OverlapEvaluator {
34-
//This static field public but not final, and could be changed by malicious code or by accident from another package. The field could be made final to avoid this vulnerability.
3534
public static boolean VERBOSE = true
3635

3736
private final JointSample jointSample

0 commit comments

Comments
 (0)