SVDServiceImpl implements SVDService { @Override public SVDValueObject svd( Long eeId ) { ExpressionExperiment ee = expressionExperimentService.load( eeId ); return svdServiceHelper.svd( ee ); }  @Override SVDValueObject getSvd( Long eeId ); @Override SVDValueObject getSvdFactorAnalysis( Long eeId ); @Override Map<ProbeLoading, DoubleVectorValueObject> getTopLoadedVectors( Long eeId, int component, int count ); @Override boolean hasPca( Long eeId ); @Override SVDValueObject svd( Long eeId );  }
@Test public void testsvd() throws Exception { geoService.setGeoDomainObjectGenerator( new GeoDomainObjectGeneratorLocal( this.getTestFileBasePath( "shortTest" ) ) ); try { Collection<?> results = geoService.fetchAndLoad( "GSE674", false, true, false ); ee = ( ExpressionExperiment ) results.iterator().next(); } catch ( AlreadyExistsInSystemException e ) { ee = ( ExpressionExperiment ) ( ( Collection<?> ) e.getData() ).iterator().next(); } assertNotNull( ee ); ee = eeService.thaw( ee ); processedExpressionDataVectorService.createProcessedDataVectors( ee ); ee = eeService.findByShortName( "GSE674" ); assertNotNull( ee ); SVDValueObject svd = svdService.svd( ee.getId() ); assertNotNull( svd ); assertNotNull( svd.getvMatrix() ); assertEquals( 5, svd.getFactorCorrelations().size() ); analysisUtilService.deleteOldAnalyses( ee ); }
@Test public void testsvdGapped() throws Exception { geoService.setGeoDomainObjectGenerator( new GeoDomainObjectGeneratorLocal( this.getTestFileBasePath( "gse482short" ) ) ); try { Collection<?> results = geoService.fetchAndLoad( "GSE482", false, true, false ); ee = ( ExpressionExperiment ) results.iterator().next(); } catch ( AlreadyExistsInSystemException e ) { if ( e.getData() instanceof List ) { ee = ( ExpressionExperiment ) ( ( List<?> ) e.getData() ).iterator().next(); } else { ee = ( ExpressionExperiment ) e.getData(); } } assertNotNull( ee ); ee = eeService.thaw( ee ); processedExpressionDataVectorService.createProcessedDataVectors( ee ); ee = eeService.findByShortName( "GSE482" ); assertNotNull( ee ); SVDValueObject svd = svdService.svd( ee.getId() ); assertNotNull( svd ); assertNotNull( svd.getvMatrix() ); assertEquals( 10, svd.getBioMaterialIds().length ); }