Fix for broken unit test plus some minor changes to comments. Unit tests were broken by my pulling the site status utility function into the enum. Thankfully the unit tests caught my silly duplication of a line.
This commit is contained in:
parent
08d2da9057
commit
7060e01a8e
|
|
@ -299,7 +299,7 @@ public class ConcordanceMetrics {
|
|||
return EVAL_ONLY;
|
||||
|
||||
boolean evalSubsetTruth = VariantContextUtils.allelesAreSubset(eval,truth);
|
||||
boolean truthSubsetEval = VariantContextUtils.allelesAreSubset(eval,truth);
|
||||
boolean truthSubsetEval = VariantContextUtils.allelesAreSubset(truth,eval);
|
||||
|
||||
if ( evalSubsetTruth && truthSubsetEval )
|
||||
return ALLELES_MATCH;
|
||||
|
|
|
|||
|
|
@ -168,8 +168,9 @@ public class GenotypeConcordance extends RodWalker<List<Pair<VariantContext,Vari
|
|||
* Eval: 20 4000 A C
|
||||
* Eval: 20 4000 A AC
|
||||
* Comp: 20 4000 A C
|
||||
* So for each eval, loop through the comps. If the eval alleles (non-emptily) intersect the comp alleles, pair them up and remove
|
||||
* that comp records. Continue until we're out of evals or comps. This is n^2, but should rarely actually happen.
|
||||
* So for each eval, loop through the comps. If the types match, or for mixed types if eval alleles (non-emptily)
|
||||
* intersect the comp alleles, pair them up and remove that comp records.
|
||||
* Continue until we're out of evals or comps. This is n^2, but should rarely actually happen.
|
||||
*
|
||||
* The remaining unpaired records get paird with an empty contexts. So in the example above we'd get a list of:
|
||||
* 1 - (20,4000,A/C | 20,4000,A/C)
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ public class ConcordanceMetricsUnitTest extends BaseTest {
|
|||
}
|
||||
|
||||
@Test(enabled=true)
|
||||
public void testMismatchingAllele() {
|
||||
public void testMismatchingAlleleInAlleleSubset() {
|
||||
Pair<VariantContext,VariantContext> data = getData2();
|
||||
VariantContext eval = data.getFirst();
|
||||
VariantContext truth = data.getSecond();
|
||||
|
|
@ -709,8 +709,13 @@ public class ConcordanceMetricsUnitTest extends BaseTest {
|
|||
|
||||
List<Pair<VariantContext,VariantContext>> data = getData7();
|
||||
|
||||
int idx = 0;
|
||||
int[] expecNotMatch = new int[]{0,0,0,0,0,1,1};
|
||||
for ( Pair<VariantContext,VariantContext> varPair : data ) {
|
||||
metrics.update(varPair.getFirst(),varPair.getSecond());
|
||||
Assert.assertEquals(metrics.getOverallSiteConcordance().get(ConcordanceMetrics.SiteConcordanceType.ALLELES_DO_NOT_MATCH),expecNotMatch[idx]);
|
||||
logger.info(idx);
|
||||
idx++;
|
||||
}
|
||||
|
||||
Assert.assertEquals(metrics.getOverallSiteConcordance().get(ConcordanceMetrics.SiteConcordanceType.ALLELES_DO_NOT_MATCH),1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue