@@ -74,26 +74,22 @@ public class Compare {
7474 private float lowerHetCutoff = SignatureUtil .HET_LOWER_CUTOFF ;
7575
7676 private String excludeVcfsFile ;
77- private List <String > excludes ;
78- private String logFile ;
79-
80- private int maxCacheSize = -1 ;
77+
78+ private int maxCacheSize = -1 ;
8179
8280 private final Map <String , int []> fileIdsAndCounts = new THashMap <>();
8381 private final List <Comparison > allComparisons = new CopyOnWriteArrayList <>();
8482
8583 private final ConcurrentMap <File , Pair <SigMeta ,TIntByteHashMap >> cache = new ConcurrentHashMap <>();
86-
87- List <String > suspiciousResults = new ArrayList <>();
88-
84+
8985 private int engage () throws Exception {
9086
9187 // get excludes
9288 logger .info ("Retrieving excludes list from: " + excludeVcfsFile );
93- excludes = SignatureUtil .getEntriesFromExcludesFile (excludeVcfsFile );
89+ List < String > excludes = SignatureUtil .getEntriesFromExcludesFile (excludeVcfsFile );
9490
9591 // get qsig vcf files
96- logger .info ("Retrieving qsig vcf files from: " + Arrays . stream ( paths ). collect ( Collectors . joining ( "," ) ));
92+ logger .info ("Retrieving qsig vcf files from: " + String . join ( "," , paths ));
9793 Set <File > uniqueFiles = new THashSet <>();
9894 for (String path : paths ) {
9995 uniqueFiles .addAll (FileUtils .findFilesEndingWithFilterNIO (path , SignatureUtil .QSIG_VCF ));
@@ -112,18 +108,16 @@ private int engage() throws Exception {
112108 logger .info ("Total number of files to be compared (minus excluded files): " + files .size ());
113109
114110 if (files .isEmpty ()) {
115- logger .warn ("No files left after removing exlcuded files" );
111+ logger .warn ("No files left after removing excluded files" );
116112 return 0 ;
117113 }
118114
119115 /*
120116 * Match files on additionalSearchStrings
121117 */
122118 if (null != additionalSearchStrings && additionalSearchStrings .length > 0 ) {
123- Predicate <File > p = (File f ) -> {
124- return Arrays .stream (additionalSearchStrings ).anyMatch (s -> f .getAbsolutePath ().contains (s ));
125- };
126- files = files .stream ().filter (f -> p .test (f )).collect (Collectors .toList ());
119+ Predicate <File > p = (File f ) -> Arrays .stream (additionalSearchStrings ).anyMatch (s -> f .getAbsolutePath ().contains (s ));
120+ files = files .stream ().filter (p ).collect (Collectors .toList ());
127121 }
128122
129123
@@ -236,7 +230,7 @@ Pair<SigMeta, TIntByteHashMap> getSignatureData(File f) throws IOException {
236230
237231 Comparison c = ComparisonUtil .compareRatiosUsingSnpsFloat (r1 , r2 , new File (rg1 ), new File (rg2 ));
238232 if (c .getScore () < cutoff ) {
239- logger .warn ("rgs don't match!: " + c . toString () );
233+ logger .warn ("rgs don't match!: " + c );
240234 }
241235 }
242236 }
@@ -270,12 +264,12 @@ private void performComparisons(List<File> files) {
270264 Integer in ;
271265 while ((in = queue .poll ()) != null ) {
272266
273- logger .info ("performing comparison for : " + in . intValue () );
267+ logger .info ("performing comparison for : " + in );
274268
275269 File f1 = files .get (in );
276270 Pair <SigMeta , TIntByteHashMap > r1 = cache .get (f1 );
277271
278- for (int j = in . intValue () + 1 ; j < size ; j ++ ) {
272+ for (int j = in + 1 ; j < size ; j ++ ) {
279273 File f2 = files .get (j );
280274 Pair <SigMeta , TIntByteHashMap > r2 = cache .get (f2 );
281275
@@ -394,7 +388,7 @@ protected int setup(String args[]) throws Exception{
394388 System .err .println (Messages .COMPARE_USAGE );
395389 } else {
396390 // configure logging
397- logFile = options .getLog ();
391+ String logFile = options .getLog ();
398392 logger = QLoggerFactory .getLogger (Compare .class , logFile , options .getLogLevel ());
399393
400394
@@ -412,16 +406,16 @@ protected int setup(String args[]) throws Exception{
412406 cutoff = options .getCutoff ();
413407 }
414408
415- options .getMinCoverage ().ifPresent (i -> { minimumCoverage = i . intValue ();} );
416- options .getNoOfThreads ().ifPresent (i -> { nThreads = i . intValue ();} );
417- options .getMinRGCoverage ().ifPresent (i -> { minimumRGCoverage = i . intValue ();} );
418- options .getMaxCacheSize ().ifPresent (i -> { maxCacheSize = i . intValue ();} );
419- options .getHomCutoff ().ifPresent (s -> { homCutoff = s ;} );
420- options .getHetUpperCutoff ().ifPresent (s -> { upperHetCutoff = s ;} );
421- options .getHetLowerCutoff ().ifPresent (s -> { lowerHetCutoff = s ;} );
409+ options .getMinCoverage ().ifPresent (i -> minimumCoverage = i );
410+ options .getNoOfThreads ().ifPresent (i -> nThreads = i );
411+ options .getMinRGCoverage ().ifPresent (i -> minimumRGCoverage = i );
412+ options .getMaxCacheSize ().ifPresent (i -> maxCacheSize = i );
413+ options .getHomCutoff ().ifPresent (s -> homCutoff = s );
414+ options .getHetUpperCutoff ().ifPresent (s -> upperHetCutoff = s );
415+ options .getHetLowerCutoff ().ifPresent (s -> lowerHetCutoff = s );
422416 logger .tool ("Number of threads to use: " + nThreads );
423- logger .tool ("Setting minumim coverage to: " + minimumCoverage );
424- logger .tool ("Setting minumim RG coverage to: " + minimumRGCoverage );
417+ logger .tool ("Setting minimum coverage to: " + minimumCoverage );
418+ logger .tool ("Setting minimum RG coverage to: " + minimumRGCoverage );
425419 logger .tool ("Setting max cache size to: " + maxCacheSize );
426420 logger .tool ("Setting homCutoff to: " + homCutoff );
427421 logger .tool ("Setting upperHetCutoff to: " + upperHetCutoff );
0 commit comments