33import au .com .bytecode .opencsv .CSVReader ;
44import org .apache .commons .lang3 .StringUtils ;
55import org .apache .logging .log4j .Logger ;
6+ import org .jetbrains .annotations .NotNull ;
67import org .jetbrains .annotations .Nullable ;
7- import org .json .JSONArray ;
88import org .json .JSONObject ;
99import org .labkey .api .pipeline .PipelineJob ;
1010import org .labkey .api .pipeline .PipelineJobException ;
@@ -112,6 +112,11 @@ public static CellHashingService.CellHashingParameters createFromStep(SequenceOu
112112 ret .htoOrCiteseqBarcodesFile = htoOrCiteseqBarcodesFile == null ? new File (ctx .getSourceDirectory (), type .getAllBarcodeFileName ()) : htoOrCiteseqBarcodesFile ;
113113 ret .methods = extractMethods (step .getProvider ().getParameterByName ("methods" ).extractValue (ctx .getJob (), step .getProvider (), step .getStepIdx (), String .class ));
114114
115+ if (type == BARCODE_TYPE .hashing && ret .methods .isEmpty ())
116+ {
117+ throw new IllegalArgumentException ("Must provide at least one calling method" );
118+ }
119+
115120 return ret ;
116121 }
117122
@@ -127,10 +132,15 @@ public static CellHashingParameters createFromJson(BARCODE_TYPE type, File webse
127132 ret .htoOrCiteseqBarcodesFile = htoOrCiteseqBarcodesFile == null ? new File (webserverDir , type .getAllBarcodeFileName ()) : htoOrCiteseqBarcodesFile ;
128133 ret .methods = extractMethods (params .optString ("methods" ));
129134
135+ if (type == BARCODE_TYPE .hashing && ret .methods .isEmpty ())
136+ {
137+ throw new IllegalArgumentException ("Must provide at least one calling method" );
138+ }
139+
130140 return ret ;
131141 }
132142
133- public static List <CALLING_METHOD > extractMethods (String methodsStr ) throws PipelineJobException
143+ private static @ NotNull List <CALLING_METHOD > extractMethods (String methodsStr ) throws PipelineJobException
134144 {
135145 if (methodsStr != null )
136146 {
@@ -158,7 +168,7 @@ public static List<CALLING_METHOD> extractMethods(String methodsStr) throws Pipe
158168 }
159169 }
160170
161- return null ;
171+ return Collections . emptyList () ;
162172 }
163173
164174 public int getEffectiveReadsetId ()
0 commit comments