use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class ExpressionExperimentPlatformSwitchTest method test.
/**
* for bug 3451
*/
@Test
public void test() {
// GSE36025
//
// GPL9250
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGenerator());
Collection<?> results = geoService.fetchAndLoad("GSE36025", false, false, false);
ExpressionExperiment ee = (ExpressionExperiment) results.iterator().next();
results = geoService.fetchAndLoad("GPL13112", true, false, false);
ArrayDesign arrayDesign = (ArrayDesign) results.iterator().next();
arrayDesign = arrayDesignService.thaw(arrayDesign);
ee = experimentPlatformSwitchService.switchExperimentToArrayDesign(ee, arrayDesign);
assertNotNull(ee);
Collection<ArrayDesign> arrayDesignsUsed = experimentService.getArrayDesignsUsed(ee);
assertEquals(1, arrayDesignsUsed.size());
assertEquals(arrayDesign, arrayDesignsUsed.iterator().next());
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class MeanVarianceServiceTest method testServiceCreateOneColor.
@Test
public final void testServiceCreateOneColor() {
qt = this.createOrUpdateQt(ScaleType.LOG2);
qt.setIsNormalized(false);
quantitationTypeService.update(qt);
// update ArrayDesign to ONECOLOR
Collection<ArrayDesign> aas = eeService.getArrayDesignsUsed(ee);
assertEquals(1, aas.size());
ArrayDesign des = aas.iterator().next();
des.setTechnologyType(TechnologyType.ONECOLOR);
arrayDesignService.update(des);
// check that ArrayDesign is the right TechnologyType
aas = eeService.getArrayDesignsUsed(ee);
assertEquals(1, aas.size());
des = aas.iterator().next();
assertEquals(TechnologyType.ONECOLOR, des.getTechnologyType());
MeanVarianceRelation mvr = meanVarianceService.create(ee, true);
// convert byte[] to array[]
// warning: order may have changed
double[] means = MeanVarianceServiceTest.bac.byteArrayToDoubles(mvr.getMeans());
double[] variances = MeanVarianceServiceTest.bac.byteArrayToDoubles(mvr.getVariances());
Arrays.sort(means);
Arrays.sort(variances);
// check sizes
int expectedMeanVarianceLength = 75;
// NAs removed
int expectedLowessLength = 75;
assertEquals(expectedMeanVarianceLength, means.length);
assertEquals(expectedMeanVarianceLength, variances.length);
// check results
int idx = 0;
assertEquals(-0.3484, means[idx], 0.0001);
assertEquals(0.001569, variances[idx], 0.0001);
idx = expectedLowessLength - 1;
assertEquals(0.05115, means[idx], 0.0001);
assertEquals(0.12014, variances[idx], 0.0001);
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class MeanVarianceServiceTest method testServiceCreateTwoColor.
@Test
public final void testServiceCreateTwoColor() {
qt = this.createOrUpdateQt(ScaleType.LOG2);
qt.setIsNormalized(false);
quantitationTypeService.update(qt);
// update ArrayDesign to TWOCOLOR
Collection<ArrayDesign> aas = eeService.getArrayDesignsUsed(ee);
assertEquals(1, aas.size());
ArrayDesign des = aas.iterator().next();
des.setTechnologyType(TechnologyType.TWOCOLOR);
arrayDesignService.update(des);
aclTestUtils.checkHasAcl(des);
// check that ArrayDesign is the right TechnologyType
aas = eeService.getArrayDesignsUsed(ee);
assertEquals(1, aas.size());
des = aas.iterator().next();
assertEquals(TechnologyType.TWOCOLOR, des.getTechnologyType());
MeanVarianceRelation mvr = meanVarianceService.create(ee, true);
aclTestUtils.checkEEAcls(ee);
ee = eeService.thaw(ee);
assertEquals(97, ee.getProcessedExpressionDataVectors().size());
// convert byte[] to array[]
// warning: order may have changed
double[] means = MeanVarianceServiceTest.bac.byteArrayToDoubles(mvr.getMeans());
double[] variances = MeanVarianceServiceTest.bac.byteArrayToDoubles(mvr.getVariances());
Arrays.sort(means);
Arrays.sort(variances);
// after filtering
int expectedLength = 75;
assertEquals(expectedLength, means.length);
assertEquals(expectedLength, variances.length);
int idx = 0;
assertEquals(-0.34836, means[idx], 0.0001);
assertEquals(0.001569, variances[idx], 0.0001);
idx = expectedLength - 1;
assertEquals(0.05115, means[idx], 0.0001);
assertEquals(0.12014, variances[idx], 0.0001);
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class VectorMergingServiceTest method tearDown.
@Before
@After
public void tearDown() {
try {
ee = eeService.findByShortName("GSE3443");
if (ee != null) {
mergedAA = eeService.getArrayDesignsUsed(ee).iterator().next();
eeService.remove(ee);
if (mergedAA != null) {
mergedAA.setMergees(new HashSet<ArrayDesign>());
arrayDesignService.update(mergedAA);
mergedAA = arrayDesignService.thawLite(mergedAA);
for (ArrayDesign arrayDesign : mergedAA.getMergees()) {
arrayDesign.setMergedInto(null);
arrayDesignService.update(arrayDesign);
}
arrayDesignService.remove(mergedAA);
for (ArrayDesign arrayDesign : mergedAA.getMergees()) {
arrayDesignService.remove(arrayDesign);
}
}
}
} catch (Exception e) {
// oh well. Test might fail, it might not.
log.info(e.getMessage(), e);
}
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesign in project Gemma by PavlidisLab.
the class ArrayDesignSequenceProcessorTest method testFetchAndLoadWithIdentifiers.
@Test
public void testFetchAndLoadWithIdentifiers() throws Exception {
String fastacmdExe = Settings.getString(SimpleFastaCmd.FASTA_CMD_ENV_VAR);
if (fastacmdExe == null) {
log.warn("No fastacmd executable is configured, skipping test");
return;
}
File fi = new File(fastacmdExe);
if (!fi.canRead()) {
log.warn(fastacmdExe + " not found, skipping test");
return;
}
GeoService geoService = this.getBean(GeoService.class);
geoService.setGeoDomainObjectGenerator(new GeoDomainObjectGeneratorLocal(this.getTestFileBasePath()));
@SuppressWarnings("unchecked") final Collection<ArrayDesign> ads = (Collection<ArrayDesign>) geoService.fetchAndLoad("GPL226", true, true, false, true, true);
result = ads.iterator().next();
result = arrayDesignService.thaw(result);
// have to specify taxon as this has two taxons in it
try (InputStream f = this.getClass().getResourceAsStream("/data/loader/expression/arrayDesign/identifierTest.txt")) {
Collection<BioSequence> res = app.processArrayDesign(result, f, new String[] { "testblastdb", "testblastdbPartTwo" }, FileTools.resourceToPath("/data/loader/genome/blast"), taxon, true);
assertNotNull(res);
for (BioSequence sequence : res) {
assertNotNull(sequence.getSequence());
}
for (CompositeSequence cs : result.getCompositeSequences()) {
assert cs.getBiologicalCharacteristic() != null;
}
}
}
Aggregations