@DataProvider(name = "indexRangeData") public Object[][] indexRangeData() { final List<Object[]> result = new ArrayList<>(); final Random rdn = new Random(131313); for (int i = 0; i < nonOverlappingExomeIntervals.size(); i++) { result.add(new Object[] {nonOverlappingExomeIntervals.get(i), new IndexRange(i, i + 1)}); result.add( new Object[] { ExomeToolsTestUtils.createInterval( nonOverlappingExomeIntervals.get(i).getContig(), nonOverlappingExomeIntervals.get(i).getStart() - 1), new IndexRange(i, i) }); int j; for (j = i + 1; j < nonOverlappingExomeIntervals.size() && rdn.nextBoolean(); j++) { if (!nonOverlappingExomeIntervals .get(j) .getContig() .equals(nonOverlappingExomeIntervals.get(i).getContig())) { break; } } result.add( new Object[] { ExomeToolsTestUtils.createInterval( nonOverlappingExomeIntervals.get(i).getContig(), nonOverlappingExomeIntervals.get(i).getStart(), nonOverlappingExomeIntervals.get(j - 1).getEnd()), new IndexRange(i, j) }); } return result.toArray(new Object[result.size()][]); }
@DataProvider(name = "wrongExonLookUpData") public Object[][] wrongExonLookUpData() { return new Object[][] { {null}, {ExomeToolsTestUtils.createOverEntireContig(nonOverlappingExomeIntervals.get(0).getContig())}, { ExomeToolsTestUtils.createInterval( nonOverlappingExomeIntervals.get(0).getContig(), nonOverlappingExomeIntervals.get(0).getEnd(), nonOverlappingExomeIntervals.get(1).getStart()) } }; }
@BeforeClass public void setUp() { nonOverlappingExomeIntervals = new ArrayList<>(100); final Random rdn = new Random(13); // some "random" but fixed seed to make sure errors are deterministic. for (int i = 0; i < ExomeToolsTestUtils.REFERENCE_DICTIONARY.size(); i++) { int current = 0; final SAMSequenceRecord sequence = ExomeToolsTestUtils.REFERENCE_DICTIONARY.getSequence(i); while (current < sequence.getSequenceLength()) { int start = current + Math.max( minimumExonIntergapSize, (int) Math.round( rdn.nextGaussian() * sdExonIntergapSize + averageExonIntergapSize)); if (start >= sequence.getSequenceLength()) { break; } int size = Math.max( minimumExonSize, (int) Math.round(rdn.nextGaussian() * sdExonSize + averageExonSize)); int stop = start + size - 1; if (stop >= sequence.getSequenceLength()) { break; } nonOverlappingExomeIntervals.add( ExomeToolsTestUtils.createInterval(sequence.getSequenceName(), start, stop)); current = stop + 1; } } Collections.sort(nonOverlappingExomeIntervals, IntervalUtils.LEXICOGRAPHICAL_ORDER_COMPARATOR); exonDB = new HashedListTargetCollection<>(nonOverlappingExomeIntervals); }
@DataProvider(name = "exonLookUpData") public Object[][] exonLookUpData() { final List<Object[]> result = new ArrayList<>(); for (int i = 0; i < nonOverlappingExomeIntervals.size(); i++) { result.add( new Object[] { nonOverlappingExomeIntervals.get(i), nonOverlappingExomeIntervals.get(i), i }); } for (int i = 0; i < nonOverlappingExomeIntervals.size(); i++) { final SimpleInterval interval = nonOverlappingExomeIntervals.get(i); result.add( new Object[] { new SimpleInterval(interval.getContig(), interval.getStart(), interval.getStart()), interval, i }); } for (int i = 0; i < nonOverlappingExomeIntervals.size(); i++) { final SimpleInterval interval = nonOverlappingExomeIntervals.get(i); result.add( new Object[] { new SimpleInterval(interval.getContig(), interval.getEnd(), interval.getEnd()), interval, i }); } for (int i = 1; i < nonOverlappingExomeIntervals.size(); i++) { final SimpleInterval previous = nonOverlappingExomeIntervals.get(i - 1); final SimpleInterval next = nonOverlappingExomeIntervals.get(i); final SimpleInterval query = previous.getContig().equals(next.getContig()) ? ExomeToolsTestUtils.createInterval( previous.getContig(), previous.getEnd() + 1, next.getStart() - 1) : ExomeToolsTestUtils.createInterval(next.getContig(), 1, next.getStart() - 1); result.add(new Object[] {query, null, -i - 1}); } return result.toArray(new Object[result.size()][]); }