@@ -177,7 +177,7 @@ public static void prepareLineageMapFiles(SequenceAnalysisJobSupport support, Lo
177177 continue ;
178178 }
179179
180- File lineageMapFile = new File (sourceDirectory , genome .getGenomeId () + "_lineageMap.txt" );
180+ File lineageMapFile = FileUtil . appendName (sourceDirectory , genome .getGenomeId () + "_lineageMap.txt" );
181181 try (final CSVWriter writer = new CSVWriter (PrintWriters .getPrintWriter (lineageMapFile ), '\t' , CSVWriter .NO_QUOTE_CHARACTER ))
182182 {
183183 log .info ("writing lineage map file" );
@@ -227,7 +227,7 @@ public Output performAnalysisPerSampleLocal(AnalysisModel model, File inputBam,
227227 throw new PipelineJobException ("Genome not found: " + model .getLibraryId ());
228228 }
229229
230- File lineageMapFile = new File (getPipelineCtx ().getSourceDirectory (), referenceGenome .getGenomeId () + "_lineageMap.txt" );
230+ File lineageMapFile = FileUtil . appendName (getPipelineCtx ().getSourceDirectory (), referenceGenome .getGenomeId () + "_lineageMap.txt" );
231231 if (lineageMapFile .exists ())
232232 {
233233 getPipelineCtx ().getLogger ().debug ("deleting lineage map file: " + lineageMapFile .getName ());
@@ -264,8 +264,8 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
264264 BamIterator bi = new BamIterator (inputBam , referenceGenome .getWorkingFastaFile (), getPipelineCtx ().getLogger ());
265265
266266 List <AlignmentAggregator > aggregators = new ArrayList <>();
267- File workDir = new File (getPipelineCtx ().getSourceDirectory (), FileUtil .getBaseName (inputBam ));
268- File sbtOutputLog = new File (workDir , FileUtil .getBaseName (inputBam ) + ".sbt.txt.gz" );
267+ File workDir = FileUtil . appendName (getPipelineCtx ().getSourceDirectory (), FileUtil .getBaseName (inputBam ));
268+ File sbtOutputLog = FileUtil . appendName (workDir , FileUtil .getBaseName (inputBam ) + ".sbt.txt.gz" );
269269
270270 SequenceBasedTypingAlignmentAggregator agg = new SequenceBasedTypingAlignmentAggregator (getPipelineCtx ().getLogger (), referenceGenome .getWorkingFastaFile (), avgBaseQualityAggregator , toolParams );
271271 if (getProvider ().getParameterByName ("writeLog" ).extractValue (getPipelineCtx ().getJob (), getProvider (), getStepIdx (), Boolean .class , false ))
@@ -277,7 +277,7 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
277277 agg .setOutputLog (sbtOutputLog );
278278 }
279279
280- File lineageMapFile = new File (getPipelineCtx ().getSourceDirectory (), referenceGenome .getGenomeId () + "_lineageMap.txt" );
280+ File lineageMapFile = FileUtil . appendName (getPipelineCtx ().getSourceDirectory (), referenceGenome .getGenomeId () + "_lineageMap.txt" );
281281 if (lineageMapFile .exists ())
282282 {
283283 getPipelineCtx ().getLogger ().debug ("using lineage map: " + lineageMapFile .getName ());
@@ -371,7 +371,7 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
371371
372372 protected File getSBTSummaryFile (File outputDir , File bam )
373373 {
374- return new File (outputDir , FileUtil .getBaseName (bam ) + ".sbt_hits.txt.gz" );
374+ return FileUtil . appendName (outputDir , FileUtil .getBaseName (bam ) + ".sbt_hits.txt.gz" );
375375 }
376376
377377 public static class AlignmentGroupCompare
@@ -383,7 +383,9 @@ public AlignmentGroupCompare(final long analysisId, Container c, User u)
383383 {
384384 this .analysisId = analysisId ;
385385
386- new TableSelector (QueryService .get ().getUserSchema (u , c , "sequenceanalysis" ).getTable ("alignment_summary_grouped" ), PageFlowUtil .set ("analysis_id" , "alleles" , "lineages" , "totalLineages" , "total_reads" , "total_forward" , "total_reverse" , "valid_pairs" , "rowids" ), new SimpleFilter (FieldKey .fromString ("analysis_id" ), analysisId ), null ).forEachResults (rs -> {
386+ TableSelector ts = new TableSelector (QueryService .get ().getUserSchema (u , c , "sequenceanalysis" ).getTable ("alignment_summary_grouped" ), PageFlowUtil .set ("analysis_id" , "alleles" , "lineages" , "totalLineages" , "total_reads" , "total_forward" , "total_reverse" , "valid_pairs" , "rowids" ), new SimpleFilter (FieldKey .fromString ("analysis_id" ), analysisId ), null );
387+ ts .setNamedParameters (Map .of ("AnalysisId" , this .analysisId ));
388+ ts .forEachResults (rs -> {
387389 if (rs .getString (FieldKey .fromString ("alleles" )) == null )
388390 {
389391 return ;
0 commit comments