Skip to content

Commit de5567a

Browse files
committed
STREL-978 Fix LowDepth filter for pooled indels
The LowDepth filter was erroneously triggering on all pooled (ie. mitochondrial) indels. This was because pooled indels were the last germline variant type still using a legacy allele support counting data structure, which was not accounted for by the LowDepth test. Insted of updating the LowDepth filter test here, we extend pooled indels with a translation step to convert legacy allele support counts into the preferred current support count structure.
1 parent d18ddf3 commit de5567a

File tree

4 files changed

+53
-20
lines changed

4 files changed

+53
-20
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## v2.9.8 - 2018-09-06
2+
3+
This is a minor bugfix update from v2.9.7.
4+
5+
### Fixed
6+
- Fix depth filters for germline continuous frequency indel calls (STREL-978)
7+
- The LowDepth filter was being spuriously applied to all indels called through the continuous frequency model. This model is typically applied only to the mitochondrial chromosome to find heteroplasmic calls.
8+
- This filter is now fixed to work as documented for all variant types.
9+
110
## v2.9.7 - 2018-08-14
211

312
This is a minor bugfix update from v2.9.6.

src/c++/lib/applications/starling/gvcf_writer.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,21 +1084,7 @@ write_indel_record_instance(
10841084

10851085
os << ':' << indelSampleInfo.tier1Depth;
10861086

1087-
{
1088-
const auto& sampleReportInfo(indelSampleInfo.legacyReportInfo);
1089-
1090-
// AD:
1091-
os << ':' << sampleReportInfo.n_confident_ref_reads
1092-
<< ',' << sampleReportInfo.n_confident_indel_reads;
1093-
1094-
// ADF
1095-
os << ':' << sampleReportInfo.n_confident_ref_reads_fwd
1096-
<< ',' << sampleReportInfo.n_confident_indel_reads_fwd;
1097-
1098-
// ADR
1099-
os << ':' << sampleReportInfo.n_confident_ref_reads_rev
1100-
<< ',' << sampleReportInfo.n_confident_indel_reads_rev;
1101-
}
1087+
printSampleAD(sampleInfo.supportCounts, altAlleleCount, os);
11021088

11031089
// FT
11041090
os << ':';

src/c++/lib/applications/starling/starling_pos_processor.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,6 +1964,39 @@ process_pos_indel_digt(const pos_t pos)
19641964

19651965

19661966

1967+
/// \brief Translate the legacy indel allele support counts into the current AD/ADF/ADR reporting structure
1968+
///
1969+
/// The legacy structure was hard coded to only one indel allele. The new structure is designed to handle any number
1970+
/// of alts, as well as generalize over indel and SNV variant types. The new structure will be used to produce
1971+
/// AD/ADF/ADR counts in the VCF output and influences methods such as the LowDepth filter computation.
1972+
///
1973+
/// \param[in] legacyReportInfo - legacy indel allele support counts
1974+
/// \param[out] supportCounts - updated allele support counts
1975+
static
1976+
void
1977+
translateLegacyIndelSupportCounts(
1978+
const AlleleSampleReportInfo& legacyReportInfo,
1979+
LocusSupportingReadStats& supportCounts)
1980+
{
1981+
// translating from legacy counting means there is only one alt allele by definition:
1982+
static const unsigned nonRefAlleleCount(1);
1983+
1984+
static const unsigned refAlleleIndex(0);
1985+
static const unsigned altAlleleIndex(1);
1986+
1987+
supportCounts.setAltCount(nonRefAlleleCount);
1988+
1989+
supportCounts.fwdCounts.incrementAlleleCount(refAlleleIndex, legacyReportInfo.n_confident_ref_reads_fwd);
1990+
supportCounts.fwdCounts.incrementAlleleCount(altAlleleIndex, legacyReportInfo.n_confident_indel_reads_fwd);
1991+
supportCounts.fwdCounts.nonConfidentCount = legacyReportInfo.n_other_reads_fwd;
1992+
1993+
supportCounts.revCounts.incrementAlleleCount(refAlleleIndex, legacyReportInfo.n_confident_ref_reads_rev);
1994+
supportCounts.revCounts.incrementAlleleCount(altAlleleIndex, legacyReportInfo.n_confident_indel_reads_rev);
1995+
supportCounts.revCounts.nonConfidentCount = legacyReportInfo.n_other_reads_rev;
1996+
}
1997+
1998+
1999+
19672000
/// Fill in all sample-specific indel locus info for the continuous-frequency calling case
19682001
///
19692002
static
@@ -1986,6 +2019,9 @@ updateContinuousIndelLocusWithSampleInfo(
19862019

19872020
const GermlineIndelSampleInfo& indelSampleInfo(locus.getIndelSample(sampleIndex));
19882021

2022+
// translate the legacy read support counts into the current AD/ADF/ADR reporting structure
2023+
translateLegacyIndelSupportCounts(indelSampleInfo.legacyReportInfo, sampleInfo.supportCounts);
2024+
19892025
sampleInfo.gqx = sampleInfo.genotypeQualityPolymorphic =
19902026
starling_continuous_variant_caller::getAlleleSequencingErrorQscore(
19912027
indelSampleInfo.legacyReportInfo.n_confident_indel_reads,

src/c++/lib/starling_common/LocusSupportingReadStats.hh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//
1818
//
1919

20-
///
20+
/// \file
2121
/// \author Chris Saunders
2222
///
2323

@@ -31,7 +31,7 @@
3131
#include <vector>
3232

3333

34-
/// discretizes support observations for a set of alleles at a single locus in a single sample
34+
/// Discretizes support observations for a set of alleles at a single locus in a single sample
3535
///
3636
/// ultimately used for things like AD,ADF,ADR tags, or count-based EVS features
3737
///
@@ -110,10 +110,12 @@ struct SupportingReadCountGroup
110110
}
111111

112112
void
113-
incrementAlleleCount(const unsigned alleleIndex)
113+
incrementAlleleCount(
114+
const unsigned alleleIndex,
115+
const unsigned incrementBy = 1)
114116
{
115117
assert((alleleIndex) < _confidentAlleleCount.size());
116-
_confidentAlleleCount[alleleIndex]++;
118+
_confidentAlleleCount[alleleIndex] += incrementBy;
117119
}
118120

119121
// number of ambiguous support reads
@@ -123,7 +125,7 @@ private:
123125
};
124126

125127

126-
/// accumulate counts of confident supporting reads for each allele at a locus in one sample
128+
/// Accumulate counts of confident supporting reads for each allele at a locus in one sample
127129
///
128130
/// this generalizes older indel support count data structures in that it is
129131
/// designed with more than one alt allele in mind from the start

0 commit comments

Comments
 (0)