Search in sources :

Example 1 with SimpleExpressionExperimentMetaData

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

the class SimpleExpressionDataLoaderServiceTest method testLoad.

@Test
public final void testLoad() 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.setShortName(RandomStringUtils.randomAlphabetic(5));
    metaData.setName(RandomStringUtils.randomAlphabetic(5));
    metaData.setDescription("Simple expression data loader service test - load");
    metaData.setQuantitationTypeName("testing");
    metaData.setGeneralType(GeneralType.QUANTITATIVE);
    metaData.setScale(ScaleType.LOG2);
    metaData.setType(StandardQuantitationType.AMOUNT);
    metaData.setIsRatio(true);
    try (InputStream data = this.getClass().getResourceAsStream("/data/testdata.txt")) {
        ee = service.create(metaData, data);
    }
    ee = eeService.thaw(ee);
    assertNotNull(ee);
    assertEquals(30, ee.getRawExpressionDataVectors().size());
    assertEquals(12, ee.getBioAssays().size());
}
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 2 with SimpleExpressionExperimentMetaData

use of ubic.gemma.core.loader.expression.simple.model.SimpleExpressionExperimentMetaData 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)

Example 3 with SimpleExpressionExperimentMetaData

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

the class ExpressionDataDoubleMatrixTest method setup.

@Before
public void setup() throws Exception {
    Collection<ArrayDesign> ads = new HashSet<>();
    metaData = new SimpleExpressionExperimentMetaData();
    ArrayDesign ad = ArrayDesign.Factory.newInstance();
    ad.setName("new ad");
    ads.add(ad);
    metaData.setArrayDesigns(ads);
    Taxon taxon = Taxon.Factory.newInstance();
    taxon.setCommonName("mouse");
    taxon.setIsGenesUsable(true);
    taxon.setIsSpecies(true);
    metaData.setTaxon(taxon);
    metaData.setName("ee");
    metaData.setQuantitationTypeName("testing");
    metaData.setGeneralType(GeneralType.QUANTITATIVE);
    metaData.setScale(ScaleType.LOG2);
    metaData.setType(StandardQuantitationType.AMOUNT);
    metaData.setIsRatio(true);
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/aov.results-2-monocyte-data-bytime.bypat.data.sort")) {
        DoubleMatrix<String, String> matrix = simpleExpressionDataLoaderService.parse(data);
        ee = simpleExpressionDataLoaderService.convert(metaData, matrix);
    }
    assertNotNull(ee);
    assertEquals(200, ee.getRawExpressionDataVectors().size());
    assertEquals(59, ee.getBioAssays().size());
}
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 4 with SimpleExpressionExperimentMetaData

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

the class ExperimentalDesignImporterTestB method setup.

@Before
public void setup() throws Exception {
    super.executeSqlScript("/script/sql/add-fish-taxa.sql", false);
    SimpleExpressionExperimentMetaData metaData = new SimpleExpressionExperimentMetaData();
    Taxon salmon = taxonService.findByCommonName("salmonid");
    // doesn't matter what it is for this test, but the test data are from salmon.
    assertNotNull(salmon);
    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);
    ArrayDesign ad = ArrayDesign.Factory.newInstance();
    ad.setShortName(this.randomName());
    ad.setTechnologyType(TechnologyType.ONECOLOR);
    ad.setName("foobly foo");
    ad.setPrimaryTaxon(salmon);
    metaData.getArrayDesigns().add(ad);
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/expression/head.Gill2007gemmaExpressionData.txt")) {
        ee = simpleExpressionDataLoaderService.create(metaData, data);
    }
}
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 5 with SimpleExpressionExperimentMetaData

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

the class SimpleExpressionDataLoaderServiceTest method testLoadB.

@Test
public final void testLoadB() 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.setDescription("Simple expression data loader service test - load B");
    metaData.setQuantitationTypeName("testing");
    metaData.setGeneralType(GeneralType.QUANTITATIVE);
    metaData.setScale(ScaleType.LOG2);
    metaData.setType(StandardQuantitationType.AMOUNT);
    metaData.setIsRatio(true);
    try (InputStream data = this.getClass().getResourceAsStream("/data/loader/aov.results-2-monocyte-data-bytime.bypat.data.sort")) {
        ee = service.create(metaData, data);
    }
    ee = eeService.thaw(ee);
    assertNotNull(ee);
    assertEquals(200, ee.getRawExpressionDataVectors().size());
    assertEquals(59, ee.getBioAssays().size());
// 
}
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)

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