Search in sources :

Example 31 with AlreadyExistsInSystemException

use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.

the class GeoDatasetServiceTest method testFetchAndLoadGSE12135EXON.

@Test
public void testFetchAndLoadGSE12135EXON() throws Exception {
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
    try {
        Collection<?> results = geoService.fetchAndLoad("GSE12135", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
        aclTestUtils.checkEEAcls(ee);
    } catch (AlreadyExistsInSystemException e) {
        log.warn("Test skipped because GSE1133 was not removed from the system prior to test");
    }
}
Also used : AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 32 with AlreadyExistsInSystemException

use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.

the class GeoDatasetServiceTest method testLoadGSE28383ExonArray.

@Test
public void testLoadGSE28383ExonArray() throws Exception {
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
        Collection<?> results = geoService.fetchAndLoad("GSE28383", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        log.info("Test skipped because GSE28383 was already loaded - clean the DB before running the test");
        return;
    }
    ee = this.eeService.thawLite(ee);
    /*
         * Should load okay, even though it has no data. See bug 3981.
         */
    try {
        processedExpressionDataVectorService.computeProcessedExpressionData(ee);
        fail("Should not have any data vectors for exon arrays on first loading");
    } catch (Exception e) {
    // OK
    }
}
Also used : AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 33 with AlreadyExistsInSystemException

use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.

the class BatchInfoPopulationServiceIntegrationTest method testLoadCommandConsoleFormat.

/*
     * Another Affymetrix format - GCOS
     */
@Test
public void testLoadCommandConsoleFormat() throws Exception {
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
    ExpressionExperiment newee;
    try {
        Collection<?> results = geoService.fetchAndLoad("GSE20219", false, true, false);
        newee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        newee = (ExpressionExperiment) ((List<?>) e.getData()).iterator().next();
    }
    assertNotNull(newee);
    newee = eeService.thawLite(newee);
    assertTrue(batchInfoPopulationService.fillBatchInformation(newee, true));
    newee = eeService.thawLite(newee);
    for (ExperimentalFactor ef : newee.getExperimentalDesign().getExperimentalFactors()) {
        if (ef.getName().equals(ExperimentalFactorService.BATCH_FACTOR_NAME)) {
            for (FactorValue fv : ef.getFactorValues()) {
                assertNotNull(fv.getValue());
                // Batch_01, Batch_02 etc.
                assertTrue(fv.getValue().startsWith("Batch_0"));
            }
        }
    }
}
Also used : FactorValue(ubic.gemma.model.expression.experiment.FactorValue) ExperimentalFactor(ubic.gemma.model.expression.experiment.ExperimentalFactor) 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) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 34 with AlreadyExistsInSystemException

use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.

the class DiffExWithInvalidInteractionTest method setup.

@Before
public void setup() throws Exception {
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression")));
    try {
        Collection<?> results = geoService.fetchAndLoad("GSE50664", 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/8165_GSE50664_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 35 with AlreadyExistsInSystemException

use of ubic.gemma.core.loader.util.AlreadyExistsInSystemException in project Gemma by PavlidisLab.

the class ContinuousVariableDiffExTest method setup.

@Before
public void setup() throws Exception {
    /*
         * this is an exon array data set that has the data present. It's an annoying choice for a test in that it
         * exposes issues with our attempts to ignore the data from exon arrays until we get it from the raw CEL files.
         */
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(FileTools.resourceToPath("/data/analysis/expression/gse13949short")));
    try {
        Collection<?> results = geoService.fetchAndLoad("GSE13949", 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/gse13949short/1151_GSE13949_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)

Aggregations

AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)41 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)33 Test (org.junit.Test)29 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)29 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)27 ExperimentalFactor (ubic.gemma.model.expression.experiment.ExperimentalFactor)10 Collection (java.util.Collection)9 HashSet (java.util.HashSet)8 Before (org.junit.Before)8 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)8 InputStream (java.io.InputStream)7 List (java.util.List)7 GeoDomainObjectGenerator (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGenerator)6 ProcessedExpressionDataVector (ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector)6 ExpressionDataDoubleMatrix (ubic.gemma.core.datastructure.matrix.ExpressionDataDoubleMatrix)5 QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)5 DoubleVectorValueObject (ubic.gemma.model.expression.bioAssayData.DoubleVectorValueObject)5 DoubleMatrixReader (ubic.basecode.io.reader.DoubleMatrixReader)4 File (java.io.File)3 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)3