Skip to content

Commit e401139

Browse files
committed
Allow resume for mGAP release job after VCF inspection
1 parent 8049cbd commit e401139

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

mGAP/src/org/labkey/mgap/pipeline/mGapReleaseGenerator.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import au.com.bytecode.opencsv.CSVReader;
44
import au.com.bytecode.opencsv.CSVWriter;
5+
import com.google.common.io.Files;
56
import htsjdk.samtools.util.CloseableIterator;
67
import htsjdk.samtools.util.IOUtil;
78
import 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

Comments
 (0)