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