diff --git a/CHANGELOG.md b/CHANGELOG.md index f361d133..29dcb751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/src/c++/lib/applications/starling/gvcf_writer.cpp b/src/c++/lib/applications/starling/gvcf_writer.cpp index 950a60f1..9b2824eb 100755 --- a/src/c++/lib/applications/starling/gvcf_writer.cpp +++ b/src/c++/lib/applications/starling/gvcf_writer.cpp @@ -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 << ':'; diff --git a/src/c++/lib/applications/starling/starling_pos_processor.cpp b/src/c++/lib/applications/starling/starling_pos_processor.cpp index 133852fe..46b47619 100644 --- a/src/c++/lib/applications/starling/starling_pos_processor.cpp +++ b/src/c++/lib/applications/starling/starling_pos_processor.cpp @@ -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 @@ -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, diff --git a/src/c++/lib/starling_common/LocusSupportingReadStats.hh b/src/c++/lib/starling_common/LocusSupportingReadStats.hh index 69ab1222..8c0e6597 100644 --- a/src/c++/lib/starling_common/LocusSupportingReadStats.hh +++ b/src/c++/lib/starling_common/LocusSupportingReadStats.hh @@ -17,7 +17,7 @@ // // -/// +/// \file /// \author Chris Saunders /// @@ -31,7 +31,7 @@ #include -/// 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 /// @@ -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 @@ -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