Search in sources :

Example 11 with GeoDomainObjectGeneratorLocal

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

the class GeoDatasetServiceTest method testFetchAndLoadGSE5949.

@Test
public void testFetchAndLoadGSE5949() throws Exception {
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("GSE5949short")));
        Collection<?> results = geoService.fetchAndLoad("GSE5949", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        log.info("Test skipped because GSE5949 was already loaded - clean the DB before running the test");
        return;
    }
    ee = this.eeService.thawLite(ee);
    Collection<QuantitationType> qts = eeService.getQuantitationTypes(ee);
    assertEquals(1, qts.size());
}
Also used : AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 12 with GeoDomainObjectGeneratorLocal

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

the class GeoDatasetServiceTest method testFetchAndLoadGSE9048.

@Test
public void testFetchAndLoadGSE9048() throws Exception {
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
        Collection<?> results = geoService.fetchAndLoad("GSE9048", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        log.info("Test skipped because GSE9048 was already loaded - clean the DB before running the test");
        return;
    }
    ee = eeService.load(ee.getId());
    ee = this.eeService.thawLite(ee);
    aclTestUtils.checkEEAcls(ee);
    Collection<QuantitationType> qts = eeService.getQuantitationTypes(ee);
    assertEquals(16, qts.size());
    twoChannelMissingValues.computeMissingValues(ee);
    ee = eeService.load(ee.getId());
    ee = this.eeService.thawLite(ee);
    qts = eeService.getQuantitationTypes(ee);
    // 16 that were imported plus the detection call we added.
    assertEquals(17, qts.size());
    Collection<ProcessedExpressionDataVector> dataVectors = processedExpressionDataVectorService.computeProcessedExpressionData(ee);
    assertEquals(10, dataVectors.size());
    ee = eeService.load(ee.getId());
    ee = this.eeService.thawLite(ee);
    qts = eeService.getQuantitationTypes(ee);
    assertEquals(18, qts.size());
    File f = dataFileService.writeOrLocateDataFile(ee, true, true);
    assertTrue(f.canRead());
    assertTrue(f.length() > 0);
}
Also used : ProcessedExpressionDataVector(ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) File(java.io.File) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 13 with GeoDomainObjectGeneratorLocal

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

the class GeoDatasetServiceTest method testFetchAndLoadMultiChipPerSeriesShort.

@Test
public void testFetchAndLoadMultiChipPerSeriesShort() throws Exception {
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("shortTest")));
    /*
         * HG-U133A. GDS473 is for the other chip (B). Series is GSE674. see
         * http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gds&term=GSE674[Accession]&cmd=search
         */
    ExpressionExperiment newee;
    try {
        Collection<?> results = geoService.fetchAndLoad("GSE674", false, true, false);
        newee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        log.info("Skipping test, data already exists in db");
        return;
    }
    assertNotNull(newee);
    newee = eeService.thaw(newee);
    /*
         * Test for bug 468 (merging of subsets across GDS's)
         */
    ExperimentalFactor factor = newee.getExperimentalDesign().getExperimentalFactors().iterator().next();
    // otherwise get 4.
    assertEquals(2, factor.getFactorValues().size());
    Collection<RawExpressionDataVector> vectors = newee.getRawExpressionDataVectors();
    rawExpressionDataVectorService.thaw(vectors);
    ExpressionDataMatrixBuilder builder = new ExpressionDataMatrixBuilder(vectors);
    ExpressionDataMatrix<Double> matrix = builder.getPreferredData();
    assertNotNull(matrix);
    assertEquals(31, matrix.rows());
    assertEquals(15, matrix.columns());
    // GSM10363 = D1-U133B
    this.testMatrixValue(newee, matrix, "200000_s_at", "GSM10363", 5722.0);
    // GSM10380 = C7-U133A
    this.testMatrixValue(newee, matrix, "1007_s_at", "GSM10380", 1272.0);
}
Also used : ExpressionDataMatrixBuilder(ubic.gemma.core.analysis.preprocess.ExpressionDataMatrixBuilder) RawExpressionDataVector(ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector) ExperimentalFactor(ubic.gemma.model.expression.experiment.ExperimentalFactor) 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 14 with GeoDomainObjectGeneratorLocal

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

the class GeoDatasetServiceTest method testFetchAndLoadGSE18707.

/*
     * For bug 2312 - qts getting dropped.
     */
@Test
public void testFetchAndLoadGSE18707() throws Exception {
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
        Collection<?> results = geoService.fetchAndLoad("GSE18707", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        log.info("Test skipped because GSE18707 was already loaded - clean the DB before running the test");
        return;
    }
    // Mouse430A_2.
    ee = eeService.findByShortName("GSE18707");
    aclTestUtils.checkEEAcls(ee);
    Collection<QuantitationType> qts = eeService.getQuantitationTypes(ee);
    assertEquals(1, qts.size());
    QuantitationType qt = qts.iterator().next();
    assertEquals("Processed Affymetrix Rosetta intensity values", qt.getDescription());
    Collection<ProcessedExpressionDataVector> dataVectors = processedExpressionDataVectorService.computeProcessedExpressionData(ee);
    assertEquals(100, dataVectors.size());
    ee = eeService.findByShortName("GSE18707");
    qts = eeService.getQuantitationTypes(ee);
    assertEquals(2, qts.size());
}
Also used : ProcessedExpressionDataVector(ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 15 with GeoDomainObjectGeneratorLocal

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

the class ExperimentalDesignImporterTestC method setup.

@Before
public void setup() throws Exception {
    /*
         * Have to add ssal for this platform.
         */
    super.executeSqlScript("/script/sql/add-fish-taxa.sql", false);
    Taxon salmon = taxonService.findByCommonName("atlantic salmon");
    assertNotNull(salmon);
    /*
         * Load the array design (platform).
         */
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath("designLoadTests")));
    geoService.fetchAndLoad("GPL2899", true, true, false);
    ArrayDesign ad = arrayDesignService.findByShortName("GPL2899");
    assertNotNull(ad);
    SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
    metaData.setShortName(RandomStringUtils.randomAlphabetic(10));
    metaData.setDescription("bar");
    metaData.setIsRatio(false);
    metaData.setTaxon(salmon);
    metaData.setQuantitationTypeName("value");
    metaData.setScale(ScaleType.LOG2);
    metaData.setType(StandardQuantitationType.AMOUNT);
    metaData.getArrayDesigns().add(ad);
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/expression/geo/designLoadTests/expressionDataBrain2003TestFile.txt")) {
        ee = simpleExpressionDataLoaderService.create(metaData, data);
    }
// ee = this.eeService.thawLite( ee );
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) InputStream(java.io.InputStream) Taxon(ubic.gemma.model.genome.Taxon) SimpleExpressionExperimentMetaData(ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData) 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