Search in sources :

Example 6 with CategoryTableXYDataset

use of org.jfree.data.xy.CategoryTableXYDataset in project hmftools by hartwigmedical.

the class CopyNumberChartsTest method testUpperBoundary.

@Test
public void testUpperBoundary() {
    CategoryTableXYDataset dataset = minorAllele(newArrayList(createCopyNumber(0, 5)));
    assertEquals(5, dataset.getX(0, 0).doubleValue(), EPSILON);
    assertEquals(10, dataset.getY(0, 0).doubleValue(), EPSILON);
    dataset = minorAllele(newArrayList(createCopyNumber(0, 6)));
    assertEquals(5, dataset.getX(0, 0).doubleValue(), EPSILON);
    assertEquals(10, dataset.getY(0, 0).doubleValue(), EPSILON);
}
Also used : CategoryTableXYDataset(org.jfree.data.xy.CategoryTableXYDataset) Test(org.junit.Test)

Example 7 with CategoryTableXYDataset

use of org.jfree.data.xy.CategoryTableXYDataset in project hmftools by hartwigmedical.

the class CopyNumberChartsTest method testNegativeMinorBafs.

@Test
public void testNegativeMinorBafs() {
    CategoryTableXYDataset dataset = minorAllele(newArrayList(createCopyNumber(1.1, 1)));
    assertEquals(-0.1, dataset.getX(0, 0).doubleValue(), EPSILON);
    assertEquals(10, dataset.getY(0, 0).doubleValue(), EPSILON);
    dataset = minorAllele(newArrayList(createCopyNumber(1.7, 1)));
    assertEquals(-0.7, dataset.getX(0, 0).doubleValue(), EPSILON);
    assertEquals(10, dataset.getY(0, 0).doubleValue(), EPSILON);
}
Also used : CategoryTableXYDataset(org.jfree.data.xy.CategoryTableXYDataset) Test(org.junit.Test)

Aggregations

CategoryTableXYDataset (org.jfree.data.xy.CategoryTableXYDataset)7 NotNull (org.jetbrains.annotations.NotNull)4 Test (org.junit.Test)3 JFreeChart (org.jfree.chart.JFreeChart)2 XYPlot (org.jfree.chart.plot.XYPlot)2 StackedXYBarRenderer (org.jfree.chart.renderer.xy.StackedXYBarRenderer)2 StandardXYBarPainter (org.jfree.chart.renderer.xy.StandardXYBarPainter)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 PurpleCopyNumber (com.hartwig.hmftools.common.purple.copynumber.PurpleCopyNumber)1 PurityAdjustedSomaticVariant (com.hartwig.hmftools.common.variant.PurityAdjustedSomaticVariant)1