Search in sources :

Example 1 with GeoDomainObjectGeneratorLocal

use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.

the class BaselineDetectionTest method setUp.

@Before
public void setUp() throws Exception {
    String path = FileTools.resourceToPath("/data/loader/expression/geo/gse18162Short");
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(path));
        Collection<?> results = geoService.fetchAndLoad("GSE18162", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        // OK.
        if (e.getData() instanceof List) {
            ee = (ExpressionExperiment) ((List<?>) e.getData()).iterator().next();
        } else {
            ee = (ExpressionExperiment) e.getData();
        }
    }
    ee = this.eeService.thawLite(ee);
    if (ee.getExperimentalDesign().getExperimentalFactors().isEmpty()) {
        ee = eeService.load(ee.getId());
        ee = this.eeService.thawLite(ee);
        try (InputStream is = this.getClass().getResourceAsStream("/data/loader/expression/geo/gse18162Short/design.txt")) {
            experimentalDesignImporter.importDesign(ee, is);
        }
        ee = eeService.load(ee.getId());
        ee = this.eeService.thawLite(ee);
    }
// end setup
}
Also used : InputStream(java.io.InputStream) List(java.util.List) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) Before(org.junit.Before)

Example 2 with GeoDomainObjectGeneratorLocal

use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.

the class DiffExMetaAnalyzerServiceTest method loadSet.

private void loadSet(String acc) throws Exception {
    String path = new File(this.getClass().getResource("/data/loader/expression/geo/meta-analysis").toURI()).getAbsolutePath();
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(path));
    try {
        geoService.fetchAndLoad(acc, false, true, false);
    } catch (AlreadyExistsInSystemException ignored) {
        log.info("Set already exists in system.");
    }
}
Also used : AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) File(java.io.File) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)

Example 3 with GeoDomainObjectGeneratorLocal

use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.

the class DiffExWithInvalidInteraction2Test method setup.

@Before
public void setup() throws Exception {
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression")));
    try {
        Collection<?> results = geoService.fetchAndLoad("GSE37301", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        ee = (ExpressionExperiment) ((Collection<?>) e.getData()).iterator().next();
    }
    ee = expressionExperimentService.thawLite(ee);
    Collection<ExperimentalFactor> toremove = new HashSet<>(ee.getExperimentalDesign().getExperimentalFactors());
    for (ExperimentalFactor ef : toremove) {
        experimentalFactorService.delete(ef);
        ee.getExperimentalDesign().getExperimentalFactors().remove(ef);
    }
    expressionExperimentService.update(ee);
    processedExpressionDataVectorService.computeProcessedExpressionData(ee);
    ee = expressionExperimentService.thaw(ee);
    designImporter.importDesign(ee, this.getClass().getResourceAsStream("/data/analysis/expression/7737_GSE37301_expdesign.data.txt"));
}
Also used : ExperimentalFactor(ubic.gemma.model.expression.experiment.ExperimentalFactor) Collection(java.util.Collection) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 4 with GeoDomainObjectGeneratorLocal

use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.

the class SVDServiceImplTest method testsvd.

@Test
public void testsvd() throws Exception {
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("shortTest")));
    // also used in the GeoDatasetServiceIntegrationTest.
    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);
}
Also used : Collection(java.util.Collection) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) ExpressionExperiment(ubic.gemma.model.expression.experiment.ExpressionExperiment) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 5 with GeoDomainObjectGeneratorLocal

use of ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal in project Gemma by PavlidisLab.

the class CompositeSequenceGeneMapperServiceTest method setup.

@Before
public void setup() throws Exception {
    this.cleanup();
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("platform")));
    @SuppressWarnings("unchecked") final Collection<ArrayDesign> ads = (Collection<ArrayDesign>) geoService.fetchAndLoad(arrayAccession, true, true, false);
    ad = ads.iterator().next();
    ad = arrayDesignService.thaw(ad);
    this.loadData();
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) Collection(java.util.Collection) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) Before(org.junit.Before)

Aggregations

GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)45 AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)33 Test (org.junit.Test)30 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)30 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)23 Collection (java.util.Collection)13 Before (org.junit.Before)13 HashSet (java.util.HashSet)10 ExperimentalFactor (ubic.gemma.model.expression.experiment.ExperimentalFactor)10 ProcessedExpressionDataVector (ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector)8 InputStream (java.io.InputStream)7 List (java.util.List)7 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)7 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)7 QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)6 File (java.io.File)4 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)4 BioMaterial (ubic.gemma.model.expression.biomaterial.BioMaterial)4 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)4 ExpressionDataDoubleMatrix (ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix)3