Search in sources :

Example 6 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.

the class ExpressionExperimentBatchCorrectionServiceImpl method makeNewQuantitationType.

private QuantitationType makeNewQuantitationType(QuantitationType oldQt) {
    QuantitationType newQt = QuantitationType.Factory.newInstance();
    newQt.setIsBatchCorrected(true);
    newQt.setDescription(oldQt.getDescription());
    newQt.setIsBackground(oldQt.getIsBackground());
    newQt.setIsBackgroundSubtracted(oldQt.getIsBackgroundSubtracted());
    newQt.setGeneralType(oldQt.getGeneralType());
    newQt.setIsMaskedPreferred(oldQt.getIsMaskedPreferred());
    newQt.setIsPreferred(oldQt.getIsPreferred());
    newQt.setIsRatio(oldQt.getIsRatio());
    newQt.setScale(oldQt.getScale());
    newQt.setIsNormalized(oldQt.getIsNormalized());
    newQt.setRepresentation(oldQt.getRepresentation());
    newQt.setName(oldQt.getName());
    newQt.setType(oldQt.getType());
    newQt.setIsRecomputedFromRawData(oldQt.getIsRecomputedFromRawData());
    if (!newQt.getDescription().toLowerCase().contains(ExpressionExperimentBatchCorrectionServiceImpl.QT_DESCRIPTION_SUFFIX_FOR_BATCH_CORRECTED)) {
        newQt.setDescription(newQt.getDescription() + " " + ExpressionExperimentBatchCorrectionServiceImpl.QT_DESCRIPTION_SUFFIX_FOR_BATCH_CORRECTED);
    }
    return newQt;
}
Also used : QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType)

Example 7 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType in project Gemma by PavlidisLab.

the class GeoDatasetServiceTest method testFetchAndLoadGSE13657.

/*
     * Left out quantitation types due to bug in how quantitation types were cached during persisting, if the QTs didn't
     * have descriptions.
     */
@Test
public void testFetchAndLoadGSE13657() throws Exception {
    try {
        geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
        Collection<?> results = geoService.fetchAndLoad("GSE13657", false, true, false);
        ee = (ExpressionExperiment) results.iterator().next();
    } catch (AlreadyExistsInSystemException e) {
        log.info("Test skipped because GSE13657 was already loaded - clean the DB before running the test");
        return;
    }
    ee = this.eeService.thawLite(ee);
    aclTestUtils.checkEEAcls(ee);
    Collection<QuantitationType> qts = eeService.getQuantitationTypes(ee);
    assertEquals(13, qts.size());
    // make sure we got characteristics and treatments for both channels.
    for (BioAssay ba : ee.getBioAssays()) {
        BioMaterial bm = ba.getSampleUsed();
        assertNotNull(bm);
        log.info(bm + " " + bm.getDescription());
        assertEquals(9, bm.getCharacteristics().size());
    }
}
Also used : BioMaterial(ubic.gemma.model.expression.biomaterial.BioMaterial) AlreadyExistsInSystemException(ubic.gemma.core.loader.util.AlreadyExistsInSystemException) QuantitationType(ubic.gemma.model.common.quantitationtype.QuantitationType) BioAssay(ubic.gemma.model.expression.bioAssay.BioAssay) GeoDomainObjectGeneratorLocal(ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal) AbstractGeoServiceTest(ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest) Test(org.junit.Test)

Example 8 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType 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 9 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType 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 10 with QuantitationType

use of ubic.gemma.model.common.quantitationtype.QuantitationType 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)

Aggregations

QuantitationType (ubic.gemma.model.common.quantitationtype.QuantitationType)74 StandardQuantitationType (ubic.gemma.model.common.quantitationtype.StandardQuantitationType)30 BioAssayDimension (ubic.gemma.model.expression.bioAssayData.BioAssayDimension)20 DesignElementDataVector (ubic.gemma.model.expression.bioAssayData.DesignElementDataVector)18 Test (org.junit.Test)16 CompositeSequence (ubic.gemma.model.expression.designElement.CompositeSequence)14 RawExpressionDataVector (ubic.gemma.model.expression.bioAssayData.RawExpressionDataVector)13 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)11 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)10 ProcessedExpressionDataVector (ubic.gemma.model.expression.bioAssayData.ProcessedExpressionDataVector)10 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)8 BioMaterial (ubic.gemma.model.expression.biomaterial.BioMaterial)7 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)6 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)6 BioAssay (ubic.gemma.model.expression.bioAssay.BioAssay)6 InputStream (java.io.InputStream)5 GZIPInputStream (java.util.zip.GZIPInputStream)5 GeoSeries (ubic.gemma.core.loader.expression.geo.model.GeoSeries)5 AlreadyExistsInSystemException (ubic.gemma.core.loader.util.AlreadyExistsInSystemException)5 ByteArrayConverter (ubic.basecode.io.ByteArrayConverter)4