Skip to content

Commit 048afbf

Browse files
committed
Bugfixes to plink2 pca code
1 parent 1ce9653 commit 048afbf

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public Provider()
6363
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("--not-chr"), "excludedContigs", "Excluded Contigs", "A comma separated list of contigs to exclude, such as X,Y,MT.", "textfield", new JSONObject(){{
6464

6565
}}, "X,Y,MT"),
66-
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("--const-fid"), "constFid", "Constant FID", "Converts sample IDs to within-family IDs while setting all family IDs to a single value (default '0').", "checkbox", new JSONObject(){{
67-
put("checked", true);
68-
}}, true),
66+
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.createSwitch("--keep-autoconv"), "constFid", "Keep Autoconversion Products", "If checked, the plink intermediate files are temporarily retained. This might be helpful to debug failures.", "checkbox", new JSONObject(){{
67+
put("checked", false);
68+
}}, false),
6969
ToolParameterDescriptor.create("splitByApplication", "Split by Application", "If checked, one iteration of PCA will be performed for each application (defined by the readset).", "checkbox", null, false),
7070
ToolParameterDescriptor.create("allowableApplications", "Allowable Applications", "If Split By Application is used, then it will search readsets to find those where the VCF sample matches the readset name. This is an option extra filter that can be added, to limit to search to a specific set of applications.", "ldk-simplelabkeycombo", new JSONObject(){{
7171
put("schemaName", "sequenceanalysis");
@@ -164,6 +164,8 @@ private void runBatch(File inputVCF, File outputDirectory, VariantProcessingStep
164164
args.add(getWrapper().getExe().getPath());
165165
args.add("--pca");
166166
args.add("--allow-extra-chr");
167+
args.add("--const-fid");
168+
args.add("0");
167169

168170
String samplesToInclude = getProvider().getParameterByName(SelectSamplesStep.SAMPLE_INCLUDE).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), String.class);
169171
addSubjectSelectOptions(sampleList != null ? StringUtils.join(sampleList, ";") : samplesToInclude, args, "--keep", new File(outputDirectory, "samplesToKeep.txt"), output);
@@ -187,6 +189,13 @@ private void runBatch(File inputVCF, File outputDirectory, VariantProcessingStep
187189
args.add("--out");
188190
args.add(outPrefix.getPath());
189191

192+
// These are only written if --keep-autoconv is used:
193+
output.addIntermediateFile(new File(outPrefix.getPath() + ".pgen"));
194+
output.addIntermediateFile(new File(outPrefix.getPath() + ".pvar"));
195+
output.addIntermediateFile(new File(outPrefix.getPath() + ".psam"));
196+
output.addIntermediateFile(new File(outPrefix.getPath() + ".afreq"));
197+
output.addIntermediateFile(new File(outPrefix.getPath() + ".log"));
198+
190199
if (SequencePipelineService.get().getMaxThreads(getPipelineCtx().getLogger()) != null)
191200
{
192201
args.add("--threads");

0 commit comments

Comments
 (0)