@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void nibFileAndFastaFileIdenticalTest() throws ReferenceReadingException, IOException { ReferenceSequenceFile referenceSequenceFile = ReferenceSequenceFileFactory.getReferenceSequenceFile(resource.getFile()); Track<Sequence> track = new Track<>(); track.setType(TrackType.REF); track.setScaleFactor(SCALE_FACTOR_4_BASE); track.setId(reference.getId()); byte[] arrayOfNucleicAcids; arrayOfNucleicAcids = referenceSequenceFile.nextSequence().getBases(); Chromosome chromosome = reference.getChromosomes().get(0); track.setChromosome(chromosome); track.setStartIndex(START_INDEX); track.setEndIndex(END_INDEX); track = referenceManager.getNucleotidesResultFromNib(track); for (Sequence sequence : track.getBlocks()) { assertTrue(String.valueOf((char) (arrayOfNucleicAcids[sequence.getStartIndex() - 1])) .equals(sequence.getText())); } }
public Track<Sequence> getNucleotidesResultFromNib(Track<Sequence> track) throws ReferenceReadingException { track.setType(TrackType.REF); try { return getNucleotidesTrackFromNib(track); } catch (Ga4ghResourceUnavailableException | IOException e) { LOG.error(e.getMessage(), e); throw new ReferenceReadingException(String.valueOf(track.getId()), e); } }
ReferenceManager { public Track<Sequence> getNucleotidesResultFromNib(Track<Sequence> track) throws ReferenceReadingException { track.setType(TrackType.REF); try { return getNucleotidesTrackFromNib(track); } catch (Ga4ghResourceUnavailableException | IOException e) { LOG.error(e.getMessage(), e); throw new ReferenceReadingException(String.valueOf(track.getId()), e); } } }
ReferenceManager { public Track<Sequence> getNucleotidesResultFromNib(Track<Sequence> track) throws ReferenceReadingException { track.setType(TrackType.REF); try { return getNucleotidesTrackFromNib(track); } catch (Ga4ghResourceUnavailableException | IOException e) { LOG.error(e.getMessage(), e); throw new ReferenceReadingException(String.valueOf(track.getId()), e); } }  }
ReferenceManager { public Track<Sequence> getNucleotidesResultFromNib(Track<Sequence> track) throws ReferenceReadingException { track.setType(TrackType.REF); try { return getNucleotidesTrackFromNib(track); } catch (Ga4ghResourceUnavailableException | IOException e) { LOG.error(e.getMessage(), e); throw new ReferenceReadingException(String.valueOf(track.getId()), e); } }  Track<Sequence> getNucleotidesResultFromNib(Track<Sequence> track); @Transactional(propagation = Propagation.REQUIRED) Reference registerGenome(final ReferenceRegistrationRequest request); List<Sequence> getNucleotidesFromNibFile(int startPosition, final int endPosition,
            final long referenceId, final String chromosomeName); @Transactional(propagation = Propagation.REQUIRED) Reference unregisterGenome(final long referenceId); String getSequenceString(final int startIndex, final int endIndex,
            final Long referenceId, final String chromosomeName); byte[] getSequenceByteArray(final int startIndex, final int endIndex,
            final Long referenceId, final String chromosomeName); }
ReferenceManager { public Track<Sequence> getNucleotidesResultFromNib(Track<Sequence> track) throws ReferenceReadingException { track.setType(TrackType.REF); try { return getNucleotidesTrackFromNib(track); } catch (Ga4ghResourceUnavailableException | IOException e) { LOG.error(e.getMessage(), e); throw new ReferenceReadingException(String.valueOf(track.getId()), e); } }  Track<Sequence> getNucleotidesResultFromNib(Track<Sequence> track); @Transactional(propagation = Propagation.REQUIRED) Reference registerGenome(final ReferenceRegistrationRequest request); List<Sequence> getNucleotidesFromNibFile(int startPosition, final int endPosition,
            final long referenceId, final String chromosomeName); @Transactional(propagation = Propagation.REQUIRED) Reference unregisterGenome(final long referenceId); String getSequenceString(final int startIndex, final int endIndex,
            final Long referenceId, final String chromosomeName); byte[] getSequenceByteArray(final int startIndex, final int endIndex,
            final Long referenceId, final String chromosomeName);  }