use of ubic.gemma.model.expression.experiment.FactorValue in project Gemma by PavlidisLab.
the class DetectFactorBaselineTest method testIsBaselineA.
@Test
public void testIsBaselineA() {
FactorValue fv = FactorValue.Factory.newInstance();
fv.setValue("fv");
VocabCharacteristic c = VocabCharacteristic.Factory.newInstance();
c.setValue("control_group");
fv.getCharacteristics().add(c);
boolean actual = BaselineSelection.isBaselineCondition(fv);
assertTrue(actual);
}
use of ubic.gemma.model.expression.experiment.FactorValue in project Gemma by PavlidisLab.
the class DetectFactorBaselineTest method testIsBaselineB.
@Test
public void testIsBaselineB() {
FactorValue fv = FactorValue.Factory.newInstance();
fv.setValue("fv");
VocabCharacteristic c = VocabCharacteristic.Factory.newInstance();
c.setValueUri("http://purl.org/nbirn/birnlex/ontology/BIRNLex-Investigation.owl#birnlex_2201");
fv.getCharacteristics().add(c);
boolean actual = BaselineSelection.isBaselineCondition(fv);
assertTrue(actual);
}
use of ubic.gemma.model.expression.experiment.FactorValue in project Gemma by PavlidisLab.
the class DetectFactorBaselineTest method testIsNotBaselineA.
@Test
public void testIsNotBaselineA() {
FactorValue fv = FactorValue.Factory.newInstance();
fv.setValue("fv");
VocabCharacteristic c = VocabCharacteristic.Factory.newInstance();
c.setValueUri("http://purl.org/obo/owl/CHEBI#CHEBI_16236");
fv.getCharacteristics().add(c);
boolean actual = BaselineSelection.isBaselineCondition(fv);
assertTrue(!actual);
}
use of ubic.gemma.model.expression.experiment.FactorValue in project Gemma by PavlidisLab.
the class ExperimentalDesignImporterTestB method testParseLoadDelete.
@Test
public final void testParseLoadDelete() throws Exception {
try (InputStream is = this.getClass().getResourceAsStream("/data/loader/expression/gill2007temperatureGemmaAnnotationData.txt")) {
experimentalDesignImporter.importDesign(ee, is);
}
this.checkResults();
this.aclTestUtils.checkEEAcls(ee);
ee = this.expressionExperimentService.load(ee.getId());
ee = expressionExperimentService.thawLite(ee);
int s = ee.getExperimentalDesign().getExperimentalFactors().size();
ExperimentalFactor toDelete = ee.getExperimentalDesign().getExperimentalFactors().iterator().next();
experimentalFactorService.delete(toDelete);
ee = this.expressionExperimentService.load(ee.getId());
ee = expressionExperimentService.thawLite(ee);
assertEquals(s - 1, ee.getExperimentalDesign().getExperimentalFactors().size());
for (BioAssay ba : ee.getBioAssays()) {
BioMaterial bm = ba.getSampleUsed();
for (FactorValue fv : bm.getFactorValues()) {
assertTrue(!fv.getExperimentalFactor().equals(toDelete));
}
}
}
use of ubic.gemma.model.expression.experiment.FactorValue in project Gemma by PavlidisLab.
the class DiffExMetaAnalyzerServiceImpl method validate.
private void validate(ExpressionAnalysisResultSet rs) {
if (rs.getExperimentalFactors().size() > 1) {
throw new IllegalArgumentException("Cannot do a meta-analysis on interaction terms");
}
ExperimentalFactor factor = rs.getExperimentalFactors().iterator().next();
/*
* We need to check this just in the subset of samples actually used.
*/
BioAssaySet experimentAnalyzed = rs.getAnalysis().getExperimentAnalyzed();
assert experimentAnalyzed != null;
if (experimentAnalyzed instanceof ExpressionExperimentSubSet) {
ExpressionExperimentSubSet eesubset = (ExpressionExperimentSubSet) experimentAnalyzed;
Collection<FactorValue> factorValuesUsed = expressionExperimentSubSetService.getFactorValuesUsed(eesubset, factor);
if (factorValuesUsed.size() > 2) {
throw new IllegalArgumentException("Cannot do a meta-analysis including a factor that has more than two levels: " + factor + " has " + factor.getFactorValues().size() + " levels from " + experimentAnalyzed);
}
} else {
if (factor.getFactorValues().size() > 2) {
/*
* Note that this doesn't account for continuous factors.
*/
throw new IllegalArgumentException("Cannot do a meta-analysis including a factor that has more than two levels: " + factor + " has " + factor.getFactorValues().size() + " levels from " + experimentAnalyzed);
}
}
}
Aggregations