22
33import au .com .bytecode .opencsv .CSVReader ;
44import au .com .bytecode .opencsv .CSVWriter ;
5+ import com .google .common .io .Files ;
56import htsjdk .samtools .util .CloseableIterator ;
67import htsjdk .samtools .util .IOUtil ;
78import htsjdk .variant .variantcontext .Allele ;
@@ -1024,6 +1025,15 @@ private File getVariantTableName(JobContext ctx, File vcfInput)
10241025
10251026 private void inspectAndSummarizeVcf (JobContext ctx , File vcfInput , GeneToNameTranslator translator , ReferenceGenome genome , boolean generateSummaries ) throws PipelineJobException
10261027 {
1028+ File doneFile = new File (ctx .getWorkingDirectory (), "vcfInspect.done" );
1029+ ctx .getFileManager ().addIntermediateFile (doneFile );
1030+
1031+ if (doneFile .exists ())
1032+ {
1033+ ctx .getLogger ().info ("VCF inspection already done, skipping" );
1034+ return ;
1035+ }
1036+
10271037 long sitesInspected = 0L ;
10281038 long totalVariants = 0L ;
10291039 long totalPrivateVariants = 0L ;
@@ -1041,6 +1051,7 @@ private void inspectAndSummarizeVcf(JobContext ctx, File vcfInput, GeneToNameTra
10411051
10421052 if (sitesInspected % 1000000 == 0 )
10431053 {
1054+ ctx .getJob ().setStatus (PipelineJob .TaskStatus .running , "Inspected " + sitesInspected + " variants" );
10441055 ctx .getLogger ().info ("inspected " + sitesInspected + " variants" );
10451056 }
10461057
@@ -1301,6 +1312,15 @@ private void inspectAndSummarizeVcf(JobContext ctx, File vcfInput, GeneToNameTra
13011312
13021313 generateSummaries (ctx , vcfInput , genome , totalVariants , totalPrivateVariants , totalSubjects , typeCounts );
13031314 }
1315+
1316+ try
1317+ {
1318+ Files .touch (doneFile );
1319+ }
1320+ catch (IOException e )
1321+ {
1322+ throw new PipelineJobException (e );
1323+ }
13041324 }
13051325
13061326 public Collection <String > parseRawOmimPheno (VariantContext vc , Logger log )
0 commit comments