genepi / imputationserver

Michigan Imputation Server: A new web-based service for imputation that facilitates access to new reference panels and greatly improves user experience and productivity
https://imputationserver.sph.umich.edu/
GNU Affero General Public License v3.0
77 stars 41 forks source link

Allelle swap QC misses some counters #137

Open abought opened 5 months ago

abought commented 5 months ago

Purpose

A recent change in minimac 4.1 lead to confusing error messages: jobs were being rejected without an error message, when minimac failed due to allele swaps.

The CG QC pipeline was recently amended with an option to check allele swaps, but it appears to be incomplete. The UM team has noted two issues:

  1. What counters are checked, and,
  2. How those counters are calculated

Proposed changes

Check both counters for swaps

Allele switches/swaps may be tracked in two separate counters: "allele switch" or "allele switch + strand flips".

Strand flips check both of these counters, but allele swaps check only one of the two applicable counters.

By generating our own test data, we have verified that jobs are not correctly failed in a scenario of mixed "allele swaps + strand flips".

Allele swaps should be written to excludedsnps

Jonathan notes that the handling of Allele switches is not consistent with other QC conditions. Of the four conditions in this block: strand flips and allele mismatches are written to excluded snps, but allele switches are not.

The GenomicTools.AlleleSwitch() condition should both return and write to the exludedSnps file as it does in the other conditions.

As an example, compare the code for these two conditions.