Skip to content

Commit 83d983d

Browse files
committed
Report consensus indels
1 parent a4b2926 commit 83d983d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/LofreqAnalysis.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
152152
int totalGTThreshold = 0;
153153

154154
Map<String, List<String>> expectedLoFreq = new HashMap<>();
155-
int totalIndelGT2 = 0;
155+
int totalIndelGT1 = 0;
156+
int totalIndelGTThreshold = 0;
156157

157158
File loFreqConsensusVcf = new File(outputDir, FileUtil.getBaseName(inputBam) + ".lofreq.consensus.vcf.gz");
158159
SAMSequenceDictionary dict = SAMSequenceDictionaryExtractor.extractDictionary(referenceGenome.getSequenceDictionary().toPath());
@@ -167,12 +168,12 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
167168
{
168169
VariantContext vc = it.next();
169170
totalVariants++;
170-
if (vc.hasAttribute("AF") && vc.getAttributeAsDouble("AF", 0.0) > 0.02)
171+
if (vc.hasAttribute("AF") && vc.getAttributeAsDouble("AF", 0.0) > 0.01)
171172
{
172173
totalGT1++;
173174
if (vc.hasAttribute("INDEL"))
174175
{
175-
totalIndelGT2++;
176+
totalIndelGT1++;
176177
}
177178
}
178179

@@ -184,6 +185,10 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
184185
if (vc.hasAttribute("AF") && vc.getAttributeAsDouble("AF", 0.0) > minFractionForConsensus)
185186
{
186187
totalGTThreshold++;
188+
if (vc.hasAttribute("INDEL"))
189+
{
190+
totalIndelGTThreshold++;
191+
}
187192
String key = getHashKey(vc);
188193
List<String> line = expectedLoFreq.getOrDefault(key, new ArrayList<>());
189194

@@ -317,7 +322,7 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
317322
}
318323
}
319324

320-
String description = String.format("Total Variants: %s\nTotal GT 1 PCT: %s\nTotal GT 50 PCT: %s\nTotal Indel GT 1 PCT: %s\nPositions Below Coverage: %s\nTotal In LoFreq Consensus: %s", totalVariants, totalGT1, totalGT50, totalIndelGT2, positionsSkipped, totalGTThreshold);
325+
String description = String.format("Total Variants: %s\nTotal GT 1 PCT: %s\nTotal GT 50 PCT: %s\nTotal Indel GT 1 PCT: %s\nPositions Below Coverage: %s\nTotal In LoFreq Consensus: %s\nTotal Indel In LoFreq Consensus: %s", totalVariants, totalGT1, totalGT50, totalIndelGT1, positionsSkipped, totalGTThreshold, totalIndelGTThreshold);
321326

322327
if (!variantsBcftoolsOnly.isEmpty())
323328
{

0 commit comments

Comments
 (0)