diff --git a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java index 5ed1bb5e8..22f5a0494 100644 --- a/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java +++ b/java/src/org/broadinstitute/sting/playground/gatk/walkers/indels/IndelGenotyperWalker.java @@ -45,12 +45,17 @@ public class IndelGenotyperWalker extends ReadWalker { doc="used only with --somatic; normal sample must have at least minNormalCoverage or more reads to call germline/somatic indel", required=false) int minNormalCoverage = 4; @Argument(fullName="minFraction", shortName="minFraction", - doc="minimum fraction of reads with CONSENSUS indel at a site, out of all reads covering the site, required for a consensus call"+ + doc="Minimum fraction of reads with CONSENSUS indel at a site, out of all reads covering the site, required for a consensus call"+ " (fraction of non-consensus indels at the site is not considered here, see minConsensusFraction)", required=false) double minFraction = 0.3; @Argument(fullName="minConsensusFraction", shortName="minConsensusFraction", doc="Minimum fraction of CONSENSUS indel observations at a site wrt all indel observations at the site required to make the call", required=false) double minConsensusFraction = 0.7; + @Argument(fullName="minIndelCount", shortName="minCnt", + doc="Minimum count of reads supporting consensus indel required for making the call. "+ + " This filter supercedes minFraction, i.e. indels with acceptable minFraction at low coverage "+ + "(minIndelCount not met) will not pass.", required=false) + int minIndelCount = 0; @Argument(fullName="refseq", shortName="refseq", doc="Name of RefSeq transcript annotation file. If specified, indels will be annotated as GENOMIC/UTR/INTRON/CODING", required=false) String RefseqFileName = null; @@ -275,13 +280,16 @@ public class IndelGenotyperWalker extends ReadWalker { } /** Returns true if consensus (specified by the pair) should be considered a call given current values - * of the fraction cutoffs - * @param p - * @param coverage + * of the cutoffs. + * @param p pair with first element being the consensus indel variant, the second element being the total (consensus+others) + * count of indels at the site. + * @param coverage total coverage (number of spanning reads, including those with indel(s)) at the site. * @return */ private boolean isCall(Pair p, int coverage) { - return ( (double)p.first.getCount() > minFraction * coverage && (double) p.first.getCount() > minConsensusFraction*p.second ); + return ( p.first.getCount() >= minIndelCount && + (double)p.first.getCount() > minFraction * coverage && + (double) p.first.getCount() > minConsensusFraction*p.second ); } /** Build output line for bed file and write it to the specified output writer if the latter is not null; @@ -502,7 +510,7 @@ public class IndelGenotyperWalker extends ReadWalker { } message += "\tSOMATIC\t0/"+normal_cov; } else { - Pair p_normal = findConsensus(tumor_variants); + Pair p_normal = findConsensus(normal_variants); message += "\tGERMLINE\t"+p_normal.second+"/"+normal_cov; }