@Test @Transactional(propagation = Propagation.REQUIRES_NEW) public void testLoadHistogram() throws IOException, HistogramReadingException { BedFile bedFile = testRegisterBed(GENES_SORTED_BED_PATH); Track<Wig> histogram = new Track<>(); histogram.setId(bedFile.getId()); histogram.setChromosome(testChromosome); bedManager.loadHistogram(histogram); Assert.assertFalse(histogram.getBlocks().isEmpty()); }
public Track<Wig> loadHistogram(final Track<Wig> track) throws HistogramReadingException { TrackHelper.validateHistogramTrack(track); final BedFile bedFile = bedFileManager.load(track.getId()); final Chromosome chromosome = referenceGenomeManager.loadChromosome(track.getChromosome().getId()); Assert.notNull(chromosome, getMessage(MessagesConstants.ERROR_CHROMOSOME_ID_NOT_FOUND)); if (fileManager.checkHistogramExists(bedFile, chromosome.getName())) { track.setBlocks(loadHistogram(track, bedFile, chromosome)); return track; } else { try { return trackHelper.createHistogram(track, chromosome, bedFile, (t, f, c, portion) -> readHistogram(t, (BedFile) f, c, portion)); } catch (HistogramWritingException e) { throw new HistogramReadingException(track, e); } } }
BedManager { public Track<Wig> loadHistogram(final Track<Wig> track) throws HistogramReadingException { TrackHelper.validateHistogramTrack(track); final BedFile bedFile = bedFileManager.load(track.getId()); final Chromosome chromosome = referenceGenomeManager.loadChromosome(track.getChromosome().getId()); Assert.notNull(chromosome, getMessage(MessagesConstants.ERROR_CHROMOSOME_ID_NOT_FOUND)); if (fileManager.checkHistogramExists(bedFile, chromosome.getName())) { track.setBlocks(loadHistogram(track, bedFile, chromosome)); return track; } else { try { return trackHelper.createHistogram(track, chromosome, bedFile, (t, f, c, portion) -> readHistogram(t, (BedFile) f, c, portion)); } catch (HistogramWritingException e) { throw new HistogramReadingException(track, e); } } } }
BedManager { public Track<Wig> loadHistogram(final Track<Wig> track) throws HistogramReadingException { TrackHelper.validateHistogramTrack(track); final BedFile bedFile = bedFileManager.load(track.getId()); final Chromosome chromosome = referenceGenomeManager.loadChromosome(track.getChromosome().getId()); Assert.notNull(chromosome, getMessage(MessagesConstants.ERROR_CHROMOSOME_ID_NOT_FOUND)); if (fileManager.checkHistogramExists(bedFile, chromosome.getName())) { track.setBlocks(loadHistogram(track, bedFile, chromosome)); return track; } else { try { return trackHelper.createHistogram(track, chromosome, bedFile, (t, f, c, portion) -> readHistogram(t, (BedFile) f, c, portion)); } catch (HistogramWritingException e) { throw new HistogramReadingException(track, e); } } }  }
BedManager { public Track<Wig> loadHistogram(final Track<Wig> track) throws HistogramReadingException { TrackHelper.validateHistogramTrack(track); final BedFile bedFile = bedFileManager.load(track.getId()); final Chromosome chromosome = referenceGenomeManager.loadChromosome(track.getChromosome().getId()); Assert.notNull(chromosome, getMessage(MessagesConstants.ERROR_CHROMOSOME_ID_NOT_FOUND)); if (fileManager.checkHistogramExists(bedFile, chromosome.getName())) { track.setBlocks(loadHistogram(track, bedFile, chromosome)); return track; } else { try { return trackHelper.createHistogram(track, chromosome, bedFile, (t, f, c, portion) -> readHistogram(t, (BedFile) f, c, portion)); } catch (HistogramWritingException e) { throw new HistogramReadingException(track, e); } } }  BedFile registerBed(final IndexedFileRegistrationRequest request); Track<BedRecord> loadFeatures(final Track<BedRecord> track); Track<BedRecord> loadFeatures(final Track<BedRecord> track, String fileUrl, String indexUrl); Track<Wig> loadHistogram(final Track<Wig> track); BedFile unregisterBedFile(long bedFileId); BedFile reindexBedFile(long bedFileId); }
BedManager { public Track<Wig> loadHistogram(final Track<Wig> track) throws HistogramReadingException { TrackHelper.validateHistogramTrack(track); final BedFile bedFile = bedFileManager.load(track.getId()); final Chromosome chromosome = referenceGenomeManager.loadChromosome(track.getChromosome().getId()); Assert.notNull(chromosome, getMessage(MessagesConstants.ERROR_CHROMOSOME_ID_NOT_FOUND)); if (fileManager.checkHistogramExists(bedFile, chromosome.getName())) { track.setBlocks(loadHistogram(track, bedFile, chromosome)); return track; } else { try { return trackHelper.createHistogram(track, chromosome, bedFile, (t, f, c, portion) -> readHistogram(t, (BedFile) f, c, portion)); } catch (HistogramWritingException e) { throw new HistogramReadingException(track, e); } } }  BedFile registerBed(final IndexedFileRegistrationRequest request); Track<BedRecord> loadFeatures(final Track<BedRecord> track); Track<BedRecord> loadFeatures(final Track<BedRecord> track, String fileUrl, String indexUrl); Track<Wig> loadHistogram(final Track<Wig> track); BedFile unregisterBedFile(long bedFileId); BedFile reindexBedFile(long bedFileId);  }