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());
}
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 );
}
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());
}
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);
}
}
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());
//
}
Aggregations