@Ignore @Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void getReference() { ReferenceRegistrationRequest request = new ReferenceRegistrationRequest(); request.setType(BiologicalDataItemResourceType.GA4GH); request.setPath(referenseSetID); request.setName(NEW_NAME); Track<Sequence> trackResult = null; Track<Sequence> track = null; try { Reference reference = referenceManager.registerGenome(request); track = new Track<>(); track.setType(TrackType.REF); track.setId(reference.getId()); track.setEndIndex(END_INDEX); track.setStartIndex(START_INDEX); track.setScaleFactor(SCALE_FACTOR_4_BASE); List<Chromosome> list = referenceGenomeDao.loadAllChromosomesByReferenceId(reference.getId()); track.setChromosome(list.get(LIST_INDEX)); trackResult = referenceManager.getNucleotidesTrackFromNib(track); } catch (IOException | Ga4ghResourceUnavailableException e) { e.printStackTrace(); } assertNotNull(reference); Reference referenceNew = referenceGenomeDao.loadReferenceGenome(reference.getId()); assertEquals(PRETTY_NAME, referenceNew.getPrettyName()); assertEquals("Unexpected id bioData.", reference.getBioDataItemId(), referenceNew.getBioDataItemId()); assertEquals("Unexpected size reference.", reference.getSize(), referenceNew.getSize()); assertEquals("Unexpected chromosome.", trackResult.getChromosome().getName(), track.getChromosome().getName()); track.setScaleFactor(SCALE_FACTOR_4_GC_NEW); try { trackResult = referenceManager.getNucleotidesTrackFromNib(track); assertEquals("Unexpected id bioData.", reference.getBioDataItemId(), referenceNew.getBioDataItemId()); assertEquals("Unexpected size reference.", reference.getSize(), referenceNew.getSize()); assertEquals("Unexpected chromosome.", trackResult.getChromosome().getName(), track.getChromosome().getName()); } catch (IOException | Ga4ghResourceUnavailableException e) { e.printStackTrace(); } }
private ReferenceGA4GH getReference(final String referenceId) throws InterruptedException, IOException, ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[] {}; String locationReference = Constants.URL_GOOGLE_GENOMIC_API + Constants.URL_REFERENCE + referenceId + Constants.GOOGLE_API_KEY; String geneData = httpDataManager.fetchData(locationReference, params); return objectMapper.readValue(geneData, ReferenceGA4GH.class); }
ReferenceManager { private ReferenceGA4GH getReference(final String referenceId) throws InterruptedException, IOException, ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[] {}; String locationReference = Constants.URL_GOOGLE_GENOMIC_API + Constants.URL_REFERENCE + referenceId + Constants.GOOGLE_API_KEY; String geneData = httpDataManager.fetchData(locationReference, params); return objectMapper.readValue(geneData, ReferenceGA4GH.class); } }
ReferenceManager { private ReferenceGA4GH getReference(final String referenceId) throws InterruptedException, IOException, ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[] {}; String locationReference = Constants.URL_GOOGLE_GENOMIC_API + Constants.URL_REFERENCE + referenceId + Constants.GOOGLE_API_KEY; String geneData = httpDataManager.fetchData(locationReference, params); return objectMapper.readValue(geneData, ReferenceGA4GH.class); }  }
ReferenceManager { private ReferenceGA4GH getReference(final String referenceId) throws InterruptedException, IOException, ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[] {}; String locationReference = Constants.URL_GOOGLE_GENOMIC_API + Constants.URL_REFERENCE + referenceId + Constants.GOOGLE_API_KEY; String geneData = httpDataManager.fetchData(locationReference, params); return objectMapper.readValue(geneData, ReferenceGA4GH.class); }  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 { private ReferenceGA4GH getReference(final String referenceId) throws InterruptedException, IOException, ExternalDbUnavailableException { ParameterNameValue[] params = new ParameterNameValue[] {}; String locationReference = Constants.URL_GOOGLE_GENOMIC_API + Constants.URL_REFERENCE + referenceId + Constants.GOOGLE_API_KEY; String geneData = httpDataManager.fetchData(locationReference, params); return objectMapper.readValue(geneData, ReferenceGA4GH.class); }  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);  }