Skip to content

Commit

Permalink
STREL-978 Fix LowDepth filter for pooled indels
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ctsa committed Sep 6, 2018
1 parent d18ddf3 commit de5567a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 20 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## v2.9.8 - 2018-09-06

This is a minor bugfix update from v2.9.7.

### Fixed
- Fix depth filters for germline continuous frequency indel calls (STREL-978)
- 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.
- This filter is now fixed to work as documented for all variant types.

## v2.9.7 - 2018-08-14

This is a minor bugfix update from v2.9.6.
Expand Down
16 changes: 1 addition & 15 deletions src/c++/lib/applications/starling/gvcf_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,21 +1084,7 @@ write_indel_record_instance(

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

{
const auto& sampleReportInfo(indelSampleInfo.legacyReportInfo);

// AD:
os << ':' << sampleReportInfo.n_confident_ref_reads
<< ',' << sampleReportInfo.n_confident_indel_reads;

// ADF
os << ':' << sampleReportInfo.n_confident_ref_reads_fwd
<< ',' << sampleReportInfo.n_confident_indel_reads_fwd;

// ADR
os << ':' << sampleReportInfo.n_confident_ref_reads_rev
<< ',' << sampleReportInfo.n_confident_indel_reads_rev;
}
printSampleAD(sampleInfo.supportCounts, altAlleleCount, os);

// FT
os << ':';
Expand Down
36 changes: 36 additions & 0 deletions src/c++/lib/applications/starling/starling_pos_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,39 @@ process_pos_indel_digt(const pos_t pos)



/// \brief Translate the legacy indel allele support counts into the current AD/ADF/ADR reporting structure
///
/// The legacy structure was hard coded to only one indel allele. The new structure is designed to handle any number
/// of alts, as well as generalize over indel and SNV variant types. The new structure will be used to produce
/// AD/ADF/ADR counts in the VCF output and influences methods such as the LowDepth filter computation.
///
/// \param[in] legacyReportInfo - legacy indel allele support counts
/// \param[out] supportCounts - updated allele support counts
static
void
translateLegacyIndelSupportCounts(
const AlleleSampleReportInfo& legacyReportInfo,
LocusSupportingReadStats& supportCounts)
{
// translating from legacy counting means there is only one alt allele by definition:
static const unsigned nonRefAlleleCount(1);

static const unsigned refAlleleIndex(0);
static const unsigned altAlleleIndex(1);

supportCounts.setAltCount(nonRefAlleleCount);

supportCounts.fwdCounts.incrementAlleleCount(refAlleleIndex, legacyReportInfo.n_confident_ref_reads_fwd);
supportCounts.fwdCounts.incrementAlleleCount(altAlleleIndex, legacyReportInfo.n_confident_indel_reads_fwd);
supportCounts.fwdCounts.nonConfidentCount = legacyReportInfo.n_other_reads_fwd;

supportCounts.revCounts.incrementAlleleCount(refAlleleIndex, legacyReportInfo.n_confident_ref_reads_rev);
supportCounts.revCounts.incrementAlleleCount(altAlleleIndex, legacyReportInfo.n_confident_indel_reads_rev);
supportCounts.revCounts.nonConfidentCount = legacyReportInfo.n_other_reads_rev;
}



/// Fill in all sample-specific indel locus info for the continuous-frequency calling case
///
static
Expand All @@ -1986,6 +2019,9 @@ updateContinuousIndelLocusWithSampleInfo(

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

// translate the legacy read support counts into the current AD/ADF/ADR reporting structure
translateLegacyIndelSupportCounts(indelSampleInfo.legacyReportInfo, sampleInfo.supportCounts);

sampleInfo.gqx = sampleInfo.genotypeQualityPolymorphic =
starling_continuous_variant_caller::getAlleleSequencingErrorQscore(
indelSampleInfo.legacyReportInfo.n_confident_indel_reads,
Expand Down
12 changes: 7 additions & 5 deletions src/c++/lib/starling_common/LocusSupportingReadStats.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//
//

///
/// \file
/// \author Chris Saunders
///

Expand All @@ -31,7 +31,7 @@
#include <vector>


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

void
incrementAlleleCount(const unsigned alleleIndex)
incrementAlleleCount(
const unsigned alleleIndex,
const unsigned incrementBy = 1)
{
assert((alleleIndex) < _confidentAlleleCount.size());
_confidentAlleleCount[alleleIndex]++;
_confidentAlleleCount[alleleIndex] += incrementBy;
}

// number of ambiguous support reads
Expand All @@ -123,7 +125,7 @@ private:
};


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

0 comments on commit de5567a

Please sign in to comment.