Skip to content

Commit e12d131

Browse files
committed
Support additional args for TagPcrSummary
1 parent 48c6e0e commit e12d131

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/preprocessing/TagPcrSummaryStep.java

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@
2828
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStep;
2929
import org.labkey.api.sequenceanalysis.pipeline.AnalysisOutputImpl;
3030
import org.labkey.api.sequenceanalysis.pipeline.AnalysisStep;
31+
import org.labkey.api.sequenceanalysis.pipeline.CommandLineParam;
3132
import org.labkey.api.sequenceanalysis.pipeline.PipelineContext;
3233
import org.labkey.api.sequenceanalysis.pipeline.PipelineStepProvider;
3334
import org.labkey.api.sequenceanalysis.pipeline.ReferenceGenome;
3435
import org.labkey.api.sequenceanalysis.pipeline.SequenceAnalysisJobSupport;
3536
import org.labkey.api.sequenceanalysis.pipeline.SequencePipelineService;
3637
import org.labkey.api.sequenceanalysis.pipeline.ToolParameterDescriptor;
38+
import org.labkey.api.sequenceanalysis.run.AbstractCommandPipelineStep;
3739
import org.labkey.api.sequenceanalysis.run.AbstractDiscvrSeqWrapper;
3840
import org.labkey.api.util.PageFlowUtil;
3941
import org.labkey.sequenceanalysis.util.SequenceUtil;
@@ -48,11 +50,11 @@
4850
import java.util.Map;
4951
import java.util.concurrent.atomic.AtomicInteger;
5052

51-
public class TagPcrSummaryStep extends AbstractPipelineStep implements AnalysisStep
53+
public class TagPcrSummaryStep extends AbstractCommandPipelineStep<TagPcrSummaryStep.TagPcrWrapper> implements AnalysisStep
5254
{
5355
public TagPcrSummaryStep(PipelineStepProvider provider, PipelineContext ctx)
5456
{
55-
super(provider, ctx);
57+
super(provider, ctx, new TagPcrWrapper(ctx.getLogger()));
5658
}
5759

5860
private static final String CACHE_KEY = "tagPcrBlastMap";
@@ -72,7 +74,16 @@ public Provider()
7274
}}, true),
7375
ToolParameterDescriptor.create(DESIGN_PRIMERS, "Design Primers", "If selected, Primer3 will be used to design primers to flank integration sites", "checkbox", new JSONObject(){{
7476
put("checked", true);
75-
}}, true)
77+
}}, true),
78+
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("--reads-to-output"), "readsToOutput", "Reads To Output Per Site", "If this is non-zero, up to this many reads per integration site will be written to a FASTA file. This can serve as a way to verify the actual junction border.", "ldk-integerfield", new JSONObject(){{
79+
put("minValue", 0);
80+
}}, 25),
81+
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("-mf"), "minFraction", "Min Faction To Output", "Only sites with at least this fraction of reads will be output.", "ldk-integerfield", new JSONObject(){{
82+
put("minValue", 0);
83+
}}, 0),
84+
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.create("-ma"), "minAlignment", "Min Alignments To Output", "Only sites with at least this many alignments will be output.", "ldk-integerfield", new JSONObject(){{
85+
put("minValue", 0);
86+
}}, 3)
7687
), null, null);
7788
}
7889

@@ -132,8 +143,6 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
132143
boolean designPrimers = getProvider().getParameterByName(DESIGN_PRIMERS).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, true);
133144
boolean outputGenbank = getProvider().getParameterByName(OUTPUT_GENBANK).extractValue(getPipelineCtx().getJob(), getProvider(), getStepIdx(), Boolean.class, true);
134145

135-
TagPcrWrapper wrapper = new TagPcrWrapper(getPipelineCtx().getLogger());
136-
137146
String basename = SequenceAnalysisService.get().getUnzippedBaseName(inputBam.getName());
138147
File siteTable = new File(outputDir, basename + ".sites.txt");
139148

@@ -150,7 +159,7 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
150159
}
151160
File metrics = getMetricsFile(inputBam, getPipelineCtx().getSourceDirectory());
152161

153-
wrapper.execute(inputBam, referenceGenome.getWorkingFastaFile(), siteTable, primerTable, genbank, metrics, blastDbs.get(referenceGenome.getGenomeId()));
162+
getWrapper().execute(inputBam, referenceGenome.getWorkingFastaFile(), siteTable, primerTable, genbank, metrics, blastDbs.get(referenceGenome.getGenomeId()), getClientCommandArgs());
154163

155164
if (siteTable.exists())
156165
{
@@ -289,14 +298,14 @@ private Map<String, String> parseMetricFile(File metrics) throws PipelineJobExce
289298
return ret;
290299
}
291300

292-
private static class TagPcrWrapper extends AbstractDiscvrSeqWrapper
301+
public static class TagPcrWrapper extends AbstractDiscvrSeqWrapper
293302
{
294303
public TagPcrWrapper(Logger log)
295304
{
296305
super(log);
297306
}
298307

299-
public void execute(File bamFile, File referenceFasta, File outputTable, @Nullable File primerTable, @Nullable File genbankOutput, File metricsTable, File blastDbBase) throws PipelineJobException
308+
public void execute(File bamFile, File referenceFasta, File outputTable, @Nullable File primerTable, @Nullable File genbankOutput, File metricsTable, File blastDbBase, @Nullable List<String> extraArgs) throws PipelineJobException
300309
{
301310
List<String> args = new ArrayList<>();
302311
args.addAll(getBaseArgs());
@@ -343,6 +352,11 @@ public void execute(File bamFile, File referenceFasta, File outputTable, @Nullab
343352
args.add(maxThreads.toString());
344353
}
345354

355+
if (extraArgs != null)
356+
{
357+
args.addAll(extraArgs);
358+
}
359+
346360
execute(args);
347361
}
348362
}

0 commit comments

Comments
 (0)