@@ -322,11 +322,20 @@ else if (distinctHTOs.size() == 1)
322322 SimpleFilter filter = new SimpleFilter (FieldKey .fromString ("name" ), tokens [0 ]);
323323 filter .addCondition (FieldKey .fromString ("adaptersequence" ), tokens [1 ]);
324324
325- TableSelector ts = new TableSelector (hashtagOligos , PageFlowUtil .set ("groupname " ), filter , null );
325+ TableSelector ts = new TableSelector (hashtagOligos , PageFlowUtil .set ("groupName " ), filter , null );
326326 if (ts .exists ())
327327 {
328328 uniqueHashtagGroups .addAll (ts .getArrayList (String .class ));
329329 }
330+ else
331+ {
332+ throw new PipelineJobException ("Unable to find group for HTO: " + hto );
333+ }
334+ }
335+
336+ if (uniqueHashtagGroups .isEmpty ())
337+ {
338+ throw new PipelineJobException ("No hashing groups found!" );
330339 }
331340
332341 writeAllHashingBarcodes (uniqueHashtagGroups , job .getUser (), job .getContainer (), sourceDir );
@@ -736,8 +745,9 @@ private void writeAllHashingBarcodes(Collection<String> groupNames, User u, Cont
736745 File output = getAllHashingBarcodesFile (webserverDir );
737746 try (CSVWriter writer = new CSVWriter (PrintWriters .getPrintWriter (output ), ',' , CSVWriter .NO_QUOTE_CHARACTER ))
738747 {
739- TableInfo ti = QueryService .get ().getUserSchema (u , c , SingleCellSchema .NAME ).getTable (SingleCellSchema .TABLE_HASHING_LABELS , null );
740- TableSelector ts = new TableSelector (ti , PageFlowUtil .set ("adaptersequence" , "name" , "groupName" , "barcodePattern" ), new SimpleFilter (FieldKey .fromString ("groupname" ), groupNames , CompareType .IN ), new org .labkey .api .data .Sort ("name" ));
748+ Container target = c .isWorkbook () ? c .getParent () : c ;
749+ TableInfo ti = QueryService .get ().getUserSchema (u , target , SingleCellSchema .NAME ).getTable (SingleCellSchema .TABLE_HASHING_LABELS , null );
750+ TableSelector ts = new TableSelector (ti , PageFlowUtil .set ("adaptersequence" , "name" , "groupName" , "barcodePattern" ), new SimpleFilter (FieldKey .fromString ("groupName" ), groupNames , CompareType .IN ), new org .labkey .api .data .Sort ("name" ));
741751 ts .forEachResults (rs -> {
742752 writer .writeNext (new String []{rs .getString (FieldKey .fromString ("adaptersequence" )), rs .getString (FieldKey .fromString ("name" )), rs .getString (FieldKey .fromString ("groupName" )), rs .getString (FieldKey .fromString ("barcodePattern" ))});
743753 });
0 commit comments