use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.
the class ArrayDesignControllerImpl method populateMergeStatus.
/**
* Recursively populate the status. Recursion only goes 'up' - so the subsumer and merger, not the subsumees and
* mergees.
*/
private void populateMergeStatus(ArrayDesign arrayDesign, ArrayDesignValueObjectExt result) {
assert arrayDesign != null;
assert result != null;
Collection<ArrayDesign> subsumees = arrayDesign.getSubsumedArrayDesigns();
subsumees = arrayDesignService.thawLite(subsumees);
ArrayDesign subsumer = arrayDesign.getSubsumingArrayDesign();
Collection<ArrayDesign> mergees = arrayDesign.getMergees();
mergees = arrayDesignService.thawLite(mergees);
ArrayDesign merger = arrayDesign.getMergedInto();
if (subsumees != null && !subsumees.isEmpty()) {
Collection<ArrayDesignValueObject> subsumeesVos = ArrayDesignValueObject.create(subsumees);
result.setSubsumees(subsumeesVos);
}
if (subsumer != null) {
ArrayDesignValueObjectExt subsumerVo = new ArrayDesignValueObjectExt(new ArrayDesignValueObject(subsumer));
result.setSubsumer(subsumerVo);
// subsumer = arrayDesignService.thawLite( subsumer );
// populateMergeStatus( subsumer, subsumerVo );
}
if (mergees != null && !mergees.isEmpty()) {
Collection<ArrayDesignValueObject> mergeesVos = ArrayDesignValueObject.create(mergees);
result.setMergees(mergeesVos);
}
if (merger != null) {
ArrayDesignValueObjectExt mergerVo = new ArrayDesignValueObjectExt(new ArrayDesignValueObject(merger));
result.setMerger(mergerVo);
// merger = arrayDesignService.thawLite( merger );
// populateMergeStatus( merger, mergerVo );
}
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.
the class ArrayDesignControllerImpl method getArrayDesigns.
@Override
public Collection<ArrayDesignValueObject> getArrayDesigns(Long[] arrayDesignIds, boolean showMergees, boolean showOrphans) {
List<ArrayDesignValueObject> result = new ArrayList<>();
// If no IDs are specified, then load all expressionExperiments and show the summary (if available)
if (arrayDesignIds == null || arrayDesignIds.length == 0) {
result.addAll(arrayDesignService.loadAllValueObjects());
} else {
// if ids are specified, then display only those arrayDesigns
Collection<Long> adCol = new LinkedList<>(Arrays.asList(arrayDesignIds));
result.addAll(arrayDesignService.loadValueObjectsByIds(adCol));
}
// Filter...
Collection<ArrayDesignValueObject> toHide = new HashSet<>();
for (ArrayDesignValueObject a : result) {
if (!showMergees && a.getIsMergee() && a.getExpressionExperimentCount() == 0) {
toHide.add(a);
}
if (!showOrphans && (a.getExpressionExperimentCount() == null || a.getExpressionExperimentCount() == 0)) {
toHide.add(a);
}
}
result.removeAll(toHide);
Collections.sort(result);
return result;
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.
the class GeneralSearchControllerImpl method filterAD.
private Collection<ArrayDesignValueObject> filterAD(final Collection<ArrayDesignValueObject> toFilter, SearchSettings settings) {
Taxon tax = settings.getTaxon();
if (tax == null)
return toFilter;
Collection<ArrayDesignValueObject> filtered = new HashSet<>();
for (ArrayDesignValueObject aavo : toFilter) {
if ((aavo.getTaxon() == null) || (aavo.getTaxon().equalsIgnoreCase(tax.getCommonName()))) {
filtered.add(aavo);
}
}
return filtered;
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.
the class CuratableValueObjectTest method testCuratableValueObjectInteraction.
@Test
public void testCuratableValueObjectInteraction() {
ArrayDesignValueObject adVO = this.arrayDesignService.loadValueObject(arrayDesign);
assertFalse(adVO.getTroubled());
ExpressionExperimentDetailsValueObject eeDVO = new ExpressionExperimentDetailsValueObject(this.expressionExperimentService.loadValueObject(expressionExperiment));
eeDVO.setArrayDesigns(Collections.singleton(adVO));
assertFalse(eeDVO.getTroubled());
assertFalse(eeDVO.getActuallyTroubled());
assertFalse(eeDVO.getPlatformTroubled());
// Make array design troubled
this.curationDetailsService.update(this.arrayDesign, AuditEvent.Factory.newInstance(new Date(), AuditAction.UPDATE, "testing trouble update on platform", "trouble update details", null, TroubledStatusFlagEvent.Factory.newInstance()));
adVO = this.arrayDesignService.loadValueObject(arrayDesign);
assertTrue(adVO.getTroubled());
eeDVO = new ExpressionExperimentDetailsValueObject(this.expressionExperimentService.loadValueObject(expressionExperiment));
eeDVO.setArrayDesigns(Collections.singleton(adVO));
assertTrue(eeDVO.getTroubled());
assertFalse(eeDVO.getActuallyTroubled());
assertTrue(eeDVO.getPlatformTroubled());
// Make expression experiment troubled
this.curationDetailsService.update(this.expressionExperiment, AuditEvent.Factory.newInstance(new Date(), AuditAction.UPDATE, "testing trouble update on expression experiment", "trouble update details", null, TroubledStatusFlagEvent.Factory.newInstance()));
eeDVO = new ExpressionExperimentDetailsValueObject(this.expressionExperimentService.loadValueObject(expressionExperiment));
eeDVO.setArrayDesigns(Collections.singleton(adVO));
assertTrue(eeDVO.getTroubled());
assertTrue(eeDVO.getActuallyTroubled());
assertTrue(eeDVO.getPlatformTroubled());
}
use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.
the class CuratableValueObjectTest method testCuratableValueObjectCreation.
@Test
public void testCuratableValueObjectCreation() {
ArrayDesignValueObject adVO = this.arrayDesignService.loadValueObject(arrayDesign);
assertNotNull(adVO);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ExpressionExperimentValueObject eeVO = this.expressionExperimentService.loadValueObject(expressionExperiment);
assertNotNull(eeVO);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ExpressionExperimentDetailsValueObject eeDVO = new ExpressionExperimentDetailsValueObject(eeVO);
eeDVO.setArrayDesigns(Collections.singleton(adVO));
assertNotNull(eeDVO);
assertNotNull(eeDVO.getArrayDesigns());
}
Aggregations