Skip to content

Commit 30545b1

Browse files
committed
Add validation to mGAP release steps
1 parent 92546b9 commit 30545b1

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

mGAP/resources/etls/prime-seq.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
</columnTransforms>
132132
</destination>
133133
</transform>
134+
134135
<transform id="step5" type="RemoteQueryTransformStep">
135136
<description>Copy to local table</description>
136137
<source schemaName="mGAP" queryName="variantList" remoteSource="PRIMESEQ" sourceTimeout="0">

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ public static class Provider extends AbstractVariantProcessingStepProvider<Gener
7575
public Provider()
7676
{
7777
super("GenerateMgapTracksStep", "Generate mGAP Tracks", "GenerateMgapTracksStep", "This will use the set of sample IDs from the table mgap.releaseTrackSubsets to subset the input VCF and produce one VCF per track. It will perform basic validation and also update mgap.releaseTracks.", Arrays.asList(
78-
ToolParameterDescriptor.create("releaseVersion", "mGAP Version", "This is the string that was used to annotate novel variants.", "textfield", new JSONObject(){{
78+
ToolParameterDescriptor.create("releaseVersion", "mGAP Version", "This is the string that was used to annotate novel variants.", "ldk-numberfield", new JSONObject(){{
7979
put("allowBlank", false);
80+
put("decimalPrecision", 1);
8081
put("doNotIncludeInTemplates", true);
8182
}}, null)
8283
), null, null);
@@ -174,17 +175,7 @@ public Output processVariants(File inputVCF, File outputDirectory, ReferenceGeno
174175
}
175176

176177
// Also create the Novel Sites track:
177-
String releaseVersion = getProvider().getParameterByName("releaseVersion").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), String.class);
178-
if (releaseVersion.toLowerCase().startsWith("v"))
179-
{
180-
releaseVersion = releaseVersion.substring(1);
181-
}
182-
183-
if (!NumberUtils.isCreatable(releaseVersion))
184-
{
185-
throw new IllegalArgumentException("Expected the release version to be numeric: " + releaseVersion);
186-
}
187-
178+
Double releaseVersion = getProvider().getParameterByName("releaseVersion").extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Double.class);
188179
File novelSitesOutput = new File(outputDirectory, "mGAP_v" + releaseVersion + "_NovelSites.vcf.gz");
189180
if (new File(novelSitesOutput.getPath() + ".tbi").exists())
190181
{

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ public class mGapReleaseGenerator extends AbstractParameterizedOutputHandler<Seq
9999
public mGapReleaseGenerator()
100100
{
101101
super(ModuleLoader.getInstance().getModule(mGAPModule.class), "Create mGAP Release", "This will prepare an input VCF for use as an mGAP public release. This will optionally include: removing excess annotations and program records, limiting to SNVs (optional) and removing genotype data (optional). If genotypes are retained, the subject names will be checked for mGAP aliases and replaced as needed.", new LinkedHashSet<>(PageFlowUtil.set("sequenceanalysis/field/GenomeFileSelectorField.js")), Arrays.asList(
102-
ToolParameterDescriptor.create("releaseVersion", "Version", "This string will be used as the version when published.", "textfield", new JSONObject(){{
102+
ToolParameterDescriptor.create("releaseVersion", "Version", "This value will be used as the version when published.", "ldk-numberfield", new JSONObject(){{
103103
put("allowBlank", false);
104+
put("decimalPrecision", 1);
105+
put("doNotIncludeInTemplates", true);
104106
}}, null),
105107
ToolParameterDescriptor.createExpDataParam("gtfFile", "GTF File", "The gene file used to create these annotations.", "sequenceanalysis-genomefileselectorfield", new JSONObject()
106108
{{

0 commit comments

Comments
 (0)