Skip to content

Commit

Permalink
Fix genotype allele remapping issue
Browse files Browse the repository at this point in the history
  • Loading branch information
droazen committed Jun 24, 2019
1 parent 746c7b5 commit 9539a42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -99,7 +99,7 @@ public class Evoquer extends GATKTool {
fullName = "run-query-only",
doc = "If true, just do the query against BigQuery and retrieve the resulting records, but don't write a VCF",
optional = true)
private boolean runQueryOnly = true;
private boolean runQueryOnly = false;

@Argument(
fullName = "disable-gnarly-genotyper",
Expand Down
Expand Up @@ -536,14 +536,18 @@ private GenotypesContext mergeRefConfidenceGenotypes(final VariantContext vc,
if (!doSomaticMerge) {
if (g.hasPL()) {
// lazy initialization of the genotype index map by ploidy.
int[] perSampleIndexesOfRelevantAlleles = getIndexesOfRelevantAlleles(remappedAlleles, targetAlleles, vc.getStart(), g);
int[] perSampleIndexesOfRelevantAlleles = getIndexesOfRelevantAlleles(remappedAlleles, targetAlleles, vc.getStart(), g);
final int[] genotypeIndexMapByPloidy = genotypeIndexMapsByPloidy[ploidy] == null
? calculators.getInstance(ploidy, maximumAlleleCount).genotypeIndexMap(perSampleIndexesOfRelevantAlleles, calculators) //probably horribly slow
: genotypeIndexMapsByPloidy[ploidy];
final int[] PLs = generatePL(g, genotypeIndexMapByPloidy);
final int[] AD = g.hasAD() ? generateAD(g.getAD(), perSampleIndexesOfRelevantAlleles) : null;
genotypeBuilder.PL(PLs).AD(AD);
}

final List<Allele> remappedGTAlleles = g.getAlleles().stream().map(a -> (vc.getAlleleIndex(a) > -1 ? remappedAlleles.get(vc.getAlleleIndex(a)) : Allele.NO_CALL)).collect(Collectors.toList());
genotypeBuilder.alleles(remappedGTAlleles);
genotypeBuilder.name(name);
}
else {
genotypeBuilder.noAttributes();
Expand Down

0 comments on commit 9539a42

Please sign in to comment.