Skip to content

Commit 1df3166

Browse files
committed
Update VariantsToTable param for GATK4
1 parent 19f420e commit 1df3166

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

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

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.labkey.api.reader.Readers;
2121
import org.labkey.api.sequenceanalysis.SequenceAnalysisService;
2222
import org.labkey.api.sequenceanalysis.model.AnalysisModel;
23+
import org.labkey.api.sequenceanalysis.model.ReadData;
2324
import org.labkey.api.sequenceanalysis.model.Readset;
2425
import org.labkey.api.sequenceanalysis.pipeline.AbstractAnalysisStepProvider;
2526
import org.labkey.api.sequenceanalysis.pipeline.AbstractPipelineStep;
@@ -33,6 +34,7 @@
3334
import org.labkey.api.sequenceanalysis.pipeline.ToolParameterDescriptor;
3435
import org.labkey.api.sequenceanalysis.run.AbstractDiscvrSeqWrapper;
3536
import org.labkey.api.util.PageFlowUtil;
37+
import org.labkey.sequenceanalysis.util.SequenceUtil;
3638

3739
import java.io.File;
3840
import java.io.IOException;
@@ -134,15 +136,46 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
134136
Map<String, String> metricMap = parseMetricFile(metrics);
135137

136138
NumberFormat pf = NumberFormat.getPercentInstance();
137-
pf.setMaximumFractionDigits(6);
139+
pf.setMaximumFractionDigits(4);
140+
141+
Double hitRate = null;
142+
if (rs.getReadData() != null)
143+
{
144+
getPipelineCtx().getLogger().info("Counting total input reads");
145+
146+
int totalReads = 0;
147+
for (ReadData rd : rs.getReadData())
148+
{
149+
File forward = rd.getFile1();
150+
if (forward != null && forward.exists())
151+
{
152+
totalReads += SequenceUtil.getLineCount(forward) / 4;
153+
}
154+
}
155+
156+
getPipelineCtx().getLogger().info("initial reads: " + totalReads);
157+
158+
if (totalReads > 0)
159+
{
160+
hitRate = Integer.parseInt(metricMap.get("NumReadsSpanningJunction")) / (double) totalReads;
161+
}
162+
}
163+
else
164+
{
165+
getPipelineCtx().getLogger().error("Readset did not have information on input files");
166+
}
138167

139168
output.addSequenceOutput(siteTable,
140169
"Putative Integration Sites: " + rs.getName(),
141170
"Tag-PCR Integration Sites", rs.getReadsetId(),
142171
null,
143172
referenceGenome.getGenomeId(),
144-
"Records: " + Integer.parseInt(metricMap.get("NumReadsSpanningJunction")) + "\nJunction hit rate: " +
145-
pf.format(Double.parseDouble(metricMap.get("PctReadsSpanningJunction"))
173+
"Reads: " + metricMap.get("NumReadsSpanningJunction") +
174+
"\nJunction hit rate (of alignments): " + pf.format(Double.parseDouble(metricMap.get("PctReadsSpanningJunction")) +
175+
(hitRate == null ? "" : "\nJunction hit rate (of total reads): ") + pf.format(hitRate) +
176+
"\nIntegration Sites: " + metricMap.get("TotalIntegrationSitesOutput") +
177+
"\nAlignments Matching Insert: " + metricMap.get("FractionPrimaryAlignmentsMatchingInsert")
178+
146179
)
147180
);
148181

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public Provider()
5555
put("style", "padding-bottom: 20px;");
5656
put("isToolParam", false);
5757
}}, null),
58-
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.createSwitch("-AMD"), "amd", "Allow Missing Data", "If checked, do not require every record to contain every field", "checkbox", new JSONObject(){{
59-
put("checked", true);
60-
}}, true),
58+
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.createSwitch("-EMD"), "emd", "Error on Missing Data", "If checked, the tool will error is any variants are missing the requested fields", "checkbox", new JSONObject(){{
59+
put("checked", false);
60+
}}, false),
6161
ToolParameterDescriptor.createCommandLineParam(CommandLineParam.createSwitch("--showFiltered"), "showFiltered", "Show Filtered Data", "If checked, rows that are filtered will be included", "checkbox", new JSONObject(){{
6262
put("checked", false);
6363
}}, false),

0 commit comments

Comments
 (0)