/** Ensures that boundaries can be determined correctly based on lower and upper limits. */ @Test public void insideBoundary() { CopyNumberAlterationCriterion criterion = new CopyNumberAlterationCriterion(); CopyNumberAlterationCriterionHandler handler = CopyNumberAlterationCriterionHandler.create(criterion); criterion.setLowerLimit(2f); criterion.setUpperLimit(1f); assertFalse(criterion.isInsideBoundaryType()); assertEquals( GenomicCriteriaMatchTypeEnum.MATCH_POSITIVE_OR_NEGATIVE, handler.getSegmentValueMatchCriterionType(2f)); criterion.setLowerLimit(1f); criterion.setUpperLimit(2f); assertTrue(criterion.isInsideBoundaryType()); assertEquals( GenomicCriteriaMatchTypeEnum.NO_MATCH, handler.getSegmentValueMatchCriterionType(3f)); criterion.setLowerLimit(3f); criterion.setUpperLimit(1f); assertFalse(criterion.isInsideBoundaryType()); assertEquals( GenomicCriteriaMatchTypeEnum.MATCH_POSITIVE_OR_NEGATIVE, handler.getSegmentValueMatchCriterionType(4f)); }
/** Tests for various segment value match criterion. */ @Test public void matchCriterion() { CopyNumberAlterationCriterion criterion = new CopyNumberAlterationCriterion(); CopyNumberAlterationCriterionHandler handler = CopyNumberAlterationCriterionHandler.create(criterion); assertEquals( GenomicCriteriaMatchTypeEnum.MATCH_POSITIVE_OR_NEGATIVE, handler.getSegmentValueMatchCriterionType(2f)); criterion.setLowerLimit(1f); assertEquals( GenomicCriteriaMatchTypeEnum.MATCH_POSITIVE_OR_NEGATIVE, handler.getSegmentValueMatchCriterionType(2f)); assertEquals( GenomicCriteriaMatchTypeEnum.NO_MATCH, handler.getSegmentValueMatchCriterionType(0f)); criterion.setLowerLimit(null); criterion.setUpperLimit(4f); assertEquals( GenomicCriteriaMatchTypeEnum.MATCH_POSITIVE_OR_NEGATIVE, handler.getSegmentValueMatchCriterionType(4f)); assertEquals( GenomicCriteriaMatchTypeEnum.NO_MATCH, handler.getSegmentValueMatchCriterionType(5f)); criterion.setLowerLimit(2f); assertEquals( GenomicCriteriaMatchTypeEnum.MATCH_POSITIVE_OR_NEGATIVE, handler.getSegmentValueMatchCriterionType(2f)); assertEquals( GenomicCriteriaMatchTypeEnum.NO_MATCH, handler.getSegmentValueMatchCriterionType(1f)); assertEquals( GenomicCriteriaMatchTypeEnum.NO_MATCH, handler.getSegmentValueMatchCriterionType(5f)); }