Merge pull request #1551 from broadinstitute/rhl_hc_no_dp_ad_1322
Set AD and DP to zero if no read coverage
This commit is contained in:
commit
faeac6e5a4
|
|
@ -108,10 +108,13 @@ public class DepthPerAlleleBySample extends GenotypeAnnotation implements Standa
|
|||
if ( g == null || !g.isCalled() || ( stratifiedContext == null && alleleLikelihoodMap == null) )
|
||||
return;
|
||||
|
||||
if (alleleLikelihoodMap != null && !alleleLikelihoodMap.isEmpty())
|
||||
if (alleleLikelihoodMap != null && !alleleLikelihoodMap.isEmpty()) {
|
||||
annotateWithLikelihoods(alleleLikelihoodMap, vc, gb);
|
||||
else if ( stratifiedContext != null && (vc.isSNP()))
|
||||
} else if ( stratifiedContext != null && (vc.isSNP())) {
|
||||
annotateWithPileup(stratifiedContext, vc, gb);
|
||||
} else {
|
||||
gb.AD(new int[vc.getNAlleles()]);
|
||||
}
|
||||
}
|
||||
|
||||
private void annotateWithPileup(final AlignmentContext stratifiedContext, final VariantContext vc, final GenotypeBuilder gb) {
|
||||
|
|
|
|||
|
|
@ -137,9 +137,9 @@ public class DepthPerSampleHC extends GenotypeAnnotation implements StandardHCAn
|
|||
dp++;
|
||||
}
|
||||
}
|
||||
|
||||
gb.DP(dp);
|
||||
}
|
||||
|
||||
gb.DP(dp);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -146,10 +146,12 @@ public class QualByDepth extends InfoFieldAnnotation implements StandardAnnotati
|
|||
if ( genotype.hasAD() ) {
|
||||
final int[] AD = genotype.getAD();
|
||||
final int totalADdepth = (int)MathUtils.sum(AD);
|
||||
if ( totalADdepth - AD[0] > 1 )
|
||||
ADrestrictedDepth += totalADdepth;
|
||||
standardDepth += totalADdepth;
|
||||
continue;
|
||||
if ( totalADdepth != 0 ) {
|
||||
if (totalADdepth - AD[0] > 1)
|
||||
ADrestrictedDepth += totalADdepth;
|
||||
standardDepth += totalADdepth;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (stratifiedContexts!= null && !stratifiedContexts.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -69,17 +69,17 @@ public class UnifiedGenotyperGeneralPloidySuite1IntegrationTest extends WalkerTe
|
|||
|
||||
@Test(enabled = true)
|
||||
public void testSNP_ACS_Pools() {
|
||||
executor.PC_LSV_Test_short("-A AlleleCountBySample -maxAltAlleles 1 -ploidy 6 -out_mode EMIT_ALL_CONFIDENT_SITES", "LSV_SNP_ACS", "SNP", "90ed6f1c268b9c57ecb52b35a88b9368");
|
||||
executor.PC_LSV_Test_short("-A AlleleCountBySample -maxAltAlleles 1 -ploidy 6 -out_mode EMIT_ALL_CONFIDENT_SITES", "LSV_SNP_ACS", "SNP", "963e128314aceaab06c240850b836b10");
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
public void testBOTH_GGA_Pools() {
|
||||
executor.PC_LSV_Test(String.format("-A AlleleCountBySample -maxAltAlleles 2 -ploidy 24 -gt_mode GENOTYPE_GIVEN_ALLELES -out_mode EMIT_ALL_SITES -alleles %s", LSV_ALLELES), "LSV_BOTH_GGA", "BOTH", "5ad4dd6b0c3c170ba44fdad6d4fa58cf");
|
||||
executor.PC_LSV_Test(String.format("-A AlleleCountBySample -maxAltAlleles 2 -ploidy 24 -gt_mode GENOTYPE_GIVEN_ALLELES -out_mode EMIT_ALL_SITES -alleles %s", LSV_ALLELES), "LSV_BOTH_GGA", "BOTH", "f3bf8b59a04db9fb52dcdea76664606d");
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
public void testINDEL_GGA_Pools() {
|
||||
executor.PC_LSV_Test(String.format("-A AlleleCountBySample -maxAltAlleles 1 -ploidy 24 -gt_mode GENOTYPE_GIVEN_ALLELES -out_mode EMIT_ALL_SITES -alleles %s", LSV_ALLELES), "LSV_INDEL_GGA", "INDEL", "d26b0ba07e056b73fe4cfe873636d0d6");
|
||||
executor.PC_LSV_Test(String.format("-A AlleleCountBySample -maxAltAlleles 1 -ploidy 24 -gt_mode GENOTYPE_GIVEN_ALLELES -out_mode EMIT_ALL_SITES -alleles %s", LSV_ALLELES), "LSV_INDEL_GGA", "INDEL", "f8bae1491695d02ccb929205b4458759");
|
||||
}
|
||||
|
||||
@Test(enabled = true)
|
||||
|
|
|
|||
|
|
@ -129,12 +129,12 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
|
|||
|
||||
@Test
|
||||
public void testOutputParameterAllConfident() {
|
||||
testOutputParameters("--output_mode EMIT_ALL_CONFIDENT_SITES", "182af9490667cb6ce1415305de4f3fdd");
|
||||
testOutputParameters("--output_mode EMIT_ALL_CONFIDENT_SITES", "96567418000ec94abee98d70199a700a");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOutputParameterAllSites() {
|
||||
testOutputParameters("--output_mode EMIT_ALL_SITES", "524e85c225ce330fd094de93f078fa56");
|
||||
testOutputParameters("--output_mode EMIT_ALL_SITES", "5ccff12b34ace5e882e465047a286c5a");
|
||||
}
|
||||
|
||||
private void testOutputParameters(final String args, final String md5) {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class HaplotypeCallerComplexAndSymbolicVariantsIntegrationTest extends Wa
|
|||
|
||||
@Test
|
||||
public void testHaplotypeCallerMultiSampleComplex1() {
|
||||
HCTestComplexVariants(privateTestDir + "AFR.complex.variants.bam", "", "4f30d9c9f1eb4529071b7060e497235d");
|
||||
HCTestComplexVariants(privateTestDir + "AFR.complex.variants.bam", "", "590428bdfe466159cb8e1637aaa4f47c");
|
||||
}
|
||||
|
||||
private void HCTestSymbolicVariants(String bam, String args, String md5) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue