Search in sources :

Example 6 with SimpleExpressionExperimentMetaData

use of ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData in project Gemma by PavlidisLab.

the class SimpleExpressionDataLoaderServiceTest method testLoadDuplicatedRow.

@Test(expected = IllegalArgumentException.class)
public final void testLoadDuplicatedRow() throws Exception {
    Taxon taxon = this.getTaxon("mouse");
    SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
    ArrayDesign ad = ArrayDesign.Factory.newInstance();
    ad.setShortName(RandomStringUtils.randomAlphabetic(5));
    ad.setName(RandomStringUtils.randomAlphabetic(5));
    ad.setPrimaryTaxon(taxon);
    ad.setTechnologyType(TechnologyType.ONECOLOR);
    Collection<ArrayDesign> ads = new HashSet<>();
    ads.add(ad);
    metaData.setArrayDesigns(ads);
    metaData.setTaxon(taxon);
    metaData.setName(RandomStringUtils.randomAlphabetic(5));
    metaData.setShortName(metaData.getName());
    metaData.setQuantitationTypeName("testing");
    metaData.setDescription("Simple expression data loader service test - load duplicate row");
    metaData.setGeneralType(GeneralType.QUANTITATIVE);
    metaData.setScale(ScaleType.LOG2);
    metaData.setType(StandardQuantitationType.AMOUNT);
    metaData.setIsRatio(true);
    try (InputStream data = this.getClass().getResourceAsStream("/data/testdata.duprow.txt")) {
        ee = service.create(metaData, data);
        fail("Should have gotten an exception about duplicated row");
    }
}
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) HashSet(java.util.HashSet) Test(org.junit.Test) BaseSpringContextTest(ubic.gemma.core.testing.BaseSpringContextTest)

Example 7 with SimpleExpressionExperimentMetaData

use of ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData in project Gemma by PavlidisLab.

the class ExperimentalDesignImportDuplicateValueTest method setup.

@Before
public void setup() throws Exception {
    SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
    Taxon human = taxonService.findByCommonName("human");
    metaData.setShortName(randomName());
    metaData.setDescription("bar");
    metaData.setIsRatio(false);
    metaData.setTaxon(human);
    metaData.setQuantitationTypeName("rma");
    metaData.setScale(ScaleType.LOG2);
    metaData.setType(StandardQuantitationType.AMOUNT);
    ArrayDesign ad = ArrayDesign.Factory.newInstance();
    ad.setShortName("gfoobly_" + randomName());
    ad.setName("foobly doo loo");
    ad.setPrimaryTaxon(human);
    ad.setTechnologyType(TechnologyType.ONECOLOR);
    metaData.getArrayDesigns().add(ad);
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/expression/expdesign.import.testfull.data.txt")) {
        ee = s.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) Before(org.junit.Before)

Example 8 with SimpleExpressionExperimentMetaData

use of ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData in project Gemma by PavlidisLab.

the class ExperimentalDesignImporterTest method setup.

@Before
public void setup() throws Exception {
    SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
    Taxon human = taxonService.findByCommonName("human");
    String eeShortName = RandomStringUtils.randomAlphabetic(10);
    metaData.setShortName(eeShortName);
    metaData.setDescription("bar");
    metaData.setIsRatio(false);
    metaData.setTaxon(human);
    metaData.setQuantitationTypeName("rma");
    metaData.setScale(ScaleType.LOG2);
    metaData.setType(StandardQuantitationType.AMOUNT);
    ArrayDesign ad = ArrayDesign.Factory.newInstance();
    ad.setShortName(adName);
    ad.setName("foobly foo");
    ad.setPrimaryTaxon(human);
    ad.setTechnologyType(TechnologyType.ONECOLOR);
    metaData.getArrayDesigns().add(ad);
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/expression/experimentalDesignTestData.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) Before(org.junit.Before)

Example 9 with SimpleExpressionExperimentMetaData

use of ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData in project Gemma by PavlidisLab.

the class SimpleExpressionDataLoaderServiceTestB method testLoadWithDuplicateBioMaterials.

@Test
public final void testLoadWithDuplicateBioMaterials() throws Exception {
    /*
         * Have to add ssal for this platform.
         */
    // Taxon salmon = taxonService.findByScientificName( "atlantic salmon" );
    // if ( salmon == null ) {
    Taxon salmon = taxonService.findByCommonName("atlantic salmon");
    // }
    assertNotNull(salmon);
    /*
         * Load the array design (platform).
         */
    geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
    geoService.fetchAndLoad("GPL2716", true, true, false);
    ArrayDesign ad = arrayDesignService.findByShortName("GPL2716");
    assertNotNull(ad);
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/expression/flatfileload/gill2006hormone.head.txt")) {
        SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
        this.makeMetaData(salmon, ad, metaData);
        ee = simpleExpressionDataLoaderService.create(metaData, data);
    }
    /*
         * Do second one that has overlapping bioassay names.
         */
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/expression/flatfileload/gill2006oceanfate.head.txt")) {
        SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
        assertNotNull(salmon);
        this.makeMetaData(salmon, ad, metaData);
        ExpressionExperiment a = simpleExpressionDataLoaderService.create(metaData, data);
        // ugly, but try to
        // clean up .
        eeService.remove(a);
    }
}
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) 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 10 with SimpleExpressionExperimentMetaData

use of ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData in project Gemma by PavlidisLab.

the class TwoWayAnovaWithInteractionTest2 method setup.

@Before
public void setup() throws IOException {
    try (InputStream io = this.getClass().getResourceAsStream("/data/analysis/expression/GSE8441_expmat_8probes.txt")) {
        SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
        metaData.setShortName(RandomStringUtils.randomAlphabetic(10));
        metaData.setTaxon(taxonService.findByCommonName("mouse"));
        metaData.setQuantitationTypeName("whatever");
        // metaData.setScale( ScaleType.LOG2 ); // this is actually wrong!
        metaData.setScale(ScaleType.LINEAR);
        ArrayDesign f = ArrayDesign.Factory.newInstance();
        f.setShortName("GSE8441_test");
        f.setTechnologyType(TechnologyType.ONECOLOR);
        f.setPrimaryTaxon(metaData.getTaxon());
        metaData.getArrayDesigns().add(f);
        ee = dataLoaderService.create(metaData, io);
        designImporter.importDesign(ee, this.getClass().getResourceAsStream("/data/analysis/expression/606_GSE8441_expdesign.data.txt"));
        ee = expressionExperimentService.thaw(ee);
    }
}
Also used : InputStream(java.io.InputStream) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) SimpleExpressionExperimentMetaData(ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData) Before(org.junit.Before)

Aggregations

SimpleExpressionExperimentMetaData (ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData)11 InputStream (java.io.InputStream)10 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)10 Taxon (ubic.gemma.model.genome.Taxon)9 Before (org.junit.Before)6 Test (org.junit.Test)4 HashSet (java.util.HashSet)3 BaseSpringContextTest (ubic.gemma.core.testing.BaseSpringContextTest)3 GeoDomainObjectGeneratorLocal (ubic.gemma.core.loader.expression.geo.GeoDomainObjectGeneratorLocal)2 ExpressionExperiment (ubic.gemma.model.expression.experiment.ExpressionExperiment)2 AbstractGeoServiceTest (ubic.gemma.core.loader.expression.geo.AbstractGeoServiceTest)1