11package org .janelia .colormipsearch .cmd ;
22
3+ import java .util .ArrayList ;
34import java .util .Collections ;
45import java .util .Comparator ;
56import java .util .List ;
@@ -89,11 +90,16 @@ static class ColorDepthSearchArgs extends AbstractColorDepthMatchArgs {
8990 @ Parameter (names = {"--targets-length" }, description = "Input image file(s) length" )
9091 int targetsLength ;
9192
92- @ Parameter (names = {"--masks-tags" }, description = "Masks MIPs tags to be selected for CDS" ,
93+ @ Parameter (names = {"--mask-tags" , "-- masks-tags" }, description = "Masks MIPs tags to be selected for CDS" ,
9394 listConverter = ListValueAsFileArgConverter .class ,
9495 variableArity = true )
9596 List <String > masksTags ;
9697
98+ @ Parameter (names = {"--mask-excluded-tags" , "--masks-excluded-tags" }, description = "Masks MIPs should not have any of these tags" ,
99+ listConverter = ListValueAsFileArgConverter .class ,
100+ variableArity = true )
101+ List <String > masksExcludedTags = new ArrayList <>();
102+
97103 @ Parameter (names = {"--masks-terms" }, description = "Masks MIPs annotations (terms) to be selected for CDS" ,
98104 listConverter = ListValueAsFileArgConverter .class ,
99105 variableArity = true )
@@ -109,11 +115,16 @@ static class ColorDepthSearchArgs extends AbstractColorDepthMatchArgs {
109115 variableArity = true )
110116 List <String > masksDatasets ;
111117
112- @ Parameter (names = {"--targets-tags" }, description = "Targets MIPs tags to be selected for CDS" ,
118+ @ Parameter (names = {"--target-tags" , "-- targets-tags" }, description = "Targets MIPs tags to be selected for CDS" ,
113119 listConverter = ListValueAsFileArgConverter .class ,
114120 variableArity = true )
115121 List <String > targetsTags ;
116122
123+ @ Parameter (names = {"--target-excluded-tags" , "--targetss-excluded-tags" }, description = "Target MIPs should not have any of these tags" ,
124+ listConverter = ListValueAsFileArgConverter .class ,
125+ variableArity = true )
126+ List <String > targetsExcludedTags = new ArrayList <>();
127+
117128 @ Parameter (names = {"--targets-terms" }, description = "Targets MIPs annotations (terms) to be selected for CDS" ,
118129 listConverter = ListValueAsFileArgConverter .class ,
119130 variableArity = true )
@@ -217,6 +228,7 @@ private <M extends AbstractNeuronEntity, T extends AbstractNeuronEntity> void ru
217228 args .masksPublishedNames ,
218229 args .masksDatasets ,
219230 args .masksTags ,
231+ args .masksExcludedTags ,
220232 args .masksAnnotations ,
221233 args .excludedMasksAnnotations ,
222234 args .masksStartIndex , args .masksLength ,
@@ -228,6 +240,7 @@ private <M extends AbstractNeuronEntity, T extends AbstractNeuronEntity> void ru
228240 args .targetsPublishedNames ,
229241 args .targetsDatasets ,
230242 args .targetsTags ,
243+ args .targetsExcludedTags ,
231244 args .targetsAnnotations ,
232245 args .excludedTargetsAnnotations ,
233246 args .targetsStartIndex , args .targetsLength ,
@@ -402,6 +415,7 @@ private List<? extends AbstractNeuronEntity> readMIPs(CDMIPsReader mipsReader,
402415 List <String > mipsPublishedNames ,
403416 List <String > mipsDatasets ,
404417 List <String > mipsTags ,
418+ List <String > mipsExcludedTags ,
405419 List <String > mipsAnnotations ,
406420 List <String > excludedMipsAnnotations ,
407421 long startIndexArg , int length ,
@@ -415,6 +429,7 @@ private List<? extends AbstractNeuronEntity> readMIPs(CDMIPsReader mipsReader,
415429 .addNames (mipsPublishedNames )
416430 .addDatasets (mipsDatasets )
417431 .addTags (mipsTags )
432+ .addExcludedTags (mipsExcludedTags )
418433 .addAnnotations (mipsAnnotations )
419434 .addExcludedAnnotations (excludedMipsAnnotations )
420435 .setOffset (libraryInput .offset )
@@ -436,7 +451,7 @@ private <N extends AbstractNeuronEntity> List<N> filterProcessedNeurons(List<N>
436451 return neurons .stream ().filter (n -> n .hasProcessedTags (ProcessingType .ColorDepthSearch , processedTags )).collect (Collectors .toList ());
437452 }
438453
439- private <M extends AbstractNeuronEntity , T extends AbstractNeuronEntity > long saveCDSResults (int batchId , List <CDMatchEntity <M , T >> cdsBatchResults ) {
454+ private <M extends AbstractNeuronEntity , T extends AbstractNeuronEntity > void saveCDSResults (int batchId , List <CDMatchEntity <M , T >> cdsBatchResults ) {
440455 LOG .info ("Results batch: {} - write {} matches - memory usage {}M out of {}M" ,
441456 batchId , cdsBatchResults .size (),
442457 (Runtime .getRuntime ().totalMemory () - Runtime .getRuntime ().freeMemory ()) / _1M + 1 , // round up
@@ -448,6 +463,5 @@ private <M extends AbstractNeuronEntity, T extends AbstractNeuronEntity> long sa
448463 (Runtime .getRuntime ().totalMemory () - Runtime .getRuntime ().freeMemory ()) / _1M + 1 , // round up
449464 (Runtime .getRuntime ().totalMemory () / _1M ));
450465 System .gc (); // force garbage collection after each batch
451- return n ;
452466 }
453467}
0 commit comments