@@ -4062,23 +4062,23 @@ public ApiResponse execute(RunSequenceHandlerForm form, BindException errors) th
40624062
40634063 protected PipelineJob createOutputJob (RunSequenceHandlerForm form , Container targetContainer , String jobName , PipeRoot pr1 , SequenceOutputHandler handler , List <SequenceOutputFile > inputs , JSONObject json ) throws IOException , PipelineJobException
40644064 {
4065- validateGenomes (inputs );
4065+ validateGenomes (inputs , handler );
40664066 return new SequenceOutputHandlerJob (targetContainer , getUser (), jobName , pr1 , handler , inputs , json );
40674067 }
40684068
4069- protected void validateGenomes (List <SequenceOutputFile > inputs ) throws IllegalArgumentException
4069+ protected void validateGenomes (List <SequenceOutputFile > inputs , SequenceOutputHandler <?> handler ) throws IllegalArgumentException
40704070 {
40714071 Set <Integer > genomes = new HashSet <>();
40724072 inputs .forEach (x -> {
4073- if (x .getLibrary_id () == null )
4073+ if (x .getLibrary_id () == null && ( handler . requiresGenome () || handler . requiresSingleGenome ()) )
40744074 {
40754075 throw new IllegalArgumentException ("Input missing genome: " + x .getRowid ());
40764076 }
40774077
40784078 genomes .add (x .getLibrary_id ());
40794079 });
40804080
4081- if (genomes .size () > 1 )
4081+ if (genomes .size () > 1 && handler . requiresSingleGenome () )
40824082 {
40834083 throw new IllegalArgumentException ("All inputs must use the same base genome" );
40844084 }
@@ -4108,7 +4108,7 @@ protected PipelineJob createOutputJob(RunSequenceHandlerForm form, Container tar
41084108 String method = json .getString ("scatterGatherMethod" );
41094109 try
41104110 {
4111- validateGenomes (inputs );
4111+ validateGenomes (inputs , handler );
41124112 VariantProcessingStep .ScatterGatherMethod scatterMethod = VariantProcessingStep .ScatterGatherMethod .valueOf (method );
41134113
41144114 return new VariantProcessingJob (targetContainer , getUser (), jobName , pr1 , handler , inputs , json , scatterMethod );
0 commit comments