Skip to content

Commit a44d4d3

Browse files
committed
Improve logging around AnnotationStep
1 parent a208e1e commit a44d4d3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,14 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
502502
needToSubsetToInterval = false;
503503
}
504504

505+
final List<String> liftFields = Arrays.asList("LiftedContig", "LiftedStart", "LiftedStop", "ReverseComplementedAlleles");
506+
505507
if (useFuncotator)
506508
{
507-
addToolFieldNames("Funcotator", "-ff", options, multiAnnotated.getParentFile(), output);
509+
addToolFieldNames("Funcotator", "-ff", options, multiAnnotated.getParentFile(), output, liftFields);
508510
}
509511

510-
addToolFieldNames("SnpSift", "-ssf", options, multiAnnotated.getParentFile(), output);
512+
addToolFieldNames("SnpSift", "-ssf", options, multiAnnotated.getParentFile(), output, liftFields);
511513

512514
maRunner.execute(inputVCF, cassandraAnnotatedBackport, liftoverRejects, funcotatorAnnotatedBackport, snpSiftAnnotatedBackport, multiAnnotated, options);
513515
}
@@ -526,13 +528,17 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
526528
return output;
527529
}
528530

529-
private void addToolFieldNames(String toolName, String argName, List<String> options, File outDir, VariantProcessingStepOutputImpl output) throws PipelineJobException
531+
private void addToolFieldNames(String toolName, String argName, List<String> options, File outDir, VariantProcessingStepOutputImpl output, @Nullable List<String> extraFields) throws PipelineJobException
530532
{
531533
List<String> fields = getCachedFields(TARGET_FIELDS, toolName);
532534
File fieldFile = new File(outDir, toolName + "Fields.args");
533535
try (PrintWriter writer = PrintWriters.getPrintWriter(fieldFile))
534536
{
535537
fields.forEach(writer::println);
538+
if (extraFields != null)
539+
{
540+
extraFields.forEach(writer::println);
541+
}
536542
}
537543
catch (IOException e)
538544
{

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
7878
else
7979
{
8080
List<String> args = new ArrayList<>();
81-
for (String key : getInfoFields())
81+
List<String> infoFields = getInfoFields();
82+
getPipelineCtx().getLogger().info("Total INFO fields to retain: " + infoFields.size());
83+
if (infoFields.isEmpty())
84+
{
85+
throw new PipelineJobException("Info fields is empty");
86+
}
87+
88+
for (String key : infoFields)
8289
{
8390
args.add("-A");
8491
args.add(key);

0 commit comments

Comments
 (0)