This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Samtools mpileup meaning of IMF and IDV

Can someone explain in more detail (or point me to the corresponding documentation) the calculation of IDV (=Maximum number of reads supporting an indel) and IMF (=Maximum fraction of reads supporting an indel) samtools mpileup is adding to the vcf output. Which reads are considered as "supporting an indel"? These values significantly differ from the number of reads for the alt allele given in DP4.

Thanks,

Christian

samtools mpileup vcf

What software is making vcfs with those tags?

2 answers

IDV 1 Integer Maximum number of reads supporting an indel
IMF 1 Float Maximum fraction of reads supporting an indel

based on the introduction here: https://support.bioconductor.org/p/78318/

It doesn't appear to be documented.

The relevant section from the samtools code is

for (s = 0; s < n; ++s) {
    int na = 0, nt = 0;
    for (i = 0; i < n_plp[s]; ++i) {
        const bam_pileup1_t *p = plp[s] + i;
        if (rghash == 0 || p->aux == 0) {
            ++nt;
            if (p->indel != 0) {
                ++na;
                aux[m++] = MINUS_CONST + p->indel;
            }
        }
        j = bam_cigar2qlen(p->b->core.n_cigar, bam_get_cigar(p->b));
        if (j > max_rd_len) max_rd_len = j;
    }
    double frac = (double)na/nt;
    if ( !indel_support_ok && na >= bca->min_support && frac >= bca->min_frac )
        indel_support_ok = 1;
    if ( na > bca->max_support && frac > 0 ) bca->max_support = na, bca->max_frac = frac;
    n_alt += na;
    n_tot += nt;
}

IDV is bca->max_support and IMF is bca->max_frac.

Log in to answer this question.