@@ -505,30 +505,37 @@ private Map<NimbleGenome, File> doAlignment(List<NimbleGenome> genomes, List<Fil
505505
506506 resultMap .put (genome , reportResultsGz );
507507
508- // Also run nimble plot. Always re-run since this is fast:
509- List <String > plotArgs = new ArrayList <>();
510- plotArgs .add ("python3" );
511- plotArgs .add ("-m" );
512- plotArgs .add ("nimble" );
508+ if (SequencePipelineService .get ().hasMinLineCount (reportResultsGz , 2 ))
509+ {
510+ // Also run nimble plot. Always re-run since this is fast:
511+ List <String > plotArgs = new ArrayList <>();
512+ plotArgs .add ("python3" );
513+ plotArgs .add ("-m" );
514+ plotArgs .add ("nimble" );
513515
514- plotArgs .add ("plot" );
515- plotArgs .add ("--input_file" );
516- plotArgs .add ("/work/" + reportResultsGz .getName ());
516+ plotArgs .add ("plot" );
517+ plotArgs .add ("--input_file" );
518+ plotArgs .add ("/work/" + reportResultsGz .getName ());
517519
518- File plotResultsHtml = getReportHtmlFileFromResults (reportResultsGz );
519- if (reportResultsGz .exists ())
520- {
521- plotResultsHtml .delete ();
522- }
520+ File plotResultsHtml = getReportHtmlFileFromResults (reportResultsGz );
521+ if (reportResultsGz .exists ())
522+ {
523+ plotResultsHtml .delete ();
524+ }
523525
524- plotArgs .add ("--output_file" );
525- plotArgs .add ("/work/" + plotResultsHtml .getName ());
526+ plotArgs .add ("--output_file" );
527+ plotArgs .add ("/work/" + plotResultsHtml .getName ());
526528
527- runUsingDocker (plotArgs , output , null );
529+ runUsingDocker (plotArgs , output , null );
528530
529- if (!plotResultsHtml .exists ())
531+ if (!plotResultsHtml .exists ())
532+ {
533+ throw new PipelineJobException ("Missing file: " + plotResultsHtml .getPath ());
534+ }
535+ }
536+ else
530537 {
531- throw new PipelineJobException ( "Missing file: " + plotResultsHtml . getPath () );
538+ getPipelineCtx (). getLogger (). info ( "Only single line found in results, skipping nimble plot" );
532539 }
533540 }
534541
0 commit comments