Skip to content

Commit edab51b

Browse files
committed
Optionally allow missing samples in PlinkPcaStep
1 parent 392e1e8 commit edab51b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/variant/PlinkPcaStep.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public Provider()
7676
put("valueField", "application");
7777
put("sortField", "application");
7878
}}, null),
79+
ToolParameterDescriptor.create("allowMissingSamples", "Allow Missing Samples", "When using split by application, this controls whether or not the job should fail if a matching readset cannot be found for specific samples.", "checkbox", null, false),
7980
ToolParameterDescriptor.create(SelectSamplesStep.SAMPLE_INCLUDE, "Sample(s) Include", "Only the following samples will be included in the analysis.", "sequenceanalysis-trimmingtextarea", null, null),
8081
ToolParameterDescriptor.create(SelectSamplesStep.SAMPLE_EXCLUDE, "Samples(s) To Exclude", "The following samples will be excluded from the analysis.", "sequenceanalysis-trimmingtextarea", null, null)
8182
), Arrays.asList("sequenceanalysis/field/TrimmingTextArea.js"), "https://zzz.bwh.harvard.edu/plink/");
@@ -262,7 +263,16 @@ else if (applications.size() > 1)
262263

263264
if (!missing.isEmpty())
264265
{
265-
throw new PipelineJobException("No matching readsets with the given name found for the following samples: " + StringUtils.join(missing, ","));
266+
String msg = "No matching readsets with the given name found for the following samples: " + StringUtils.join(missing, ",");
267+
boolean allowMissingSamples = getProvider().getParameterByName("allowMissingSamples").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, false);
268+
if (allowMissingSamples)
269+
{
270+
getPipelineCtx().getLogger().warn(msg);
271+
}
272+
else
273+
{
274+
throw new PipelineJobException(msg);
275+
}
266276
}
267277
}
268278
}

0 commit comments

Comments
 (0)