Search in sources :

Example 21 with ArrayDesignValueObject

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 );
    }
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

Example 22 with ArrayDesignValueObject

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;
}
Also used : ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

Example 23 with ArrayDesignValueObject

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;
}
Also used : Taxon(ubic.gemma.model.genome.Taxon) ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

Example 24 with ArrayDesignValueObject

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());
}
Also used : ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject) ExpressionExperimentDetailsValueObject(ubic.gemma.model.expression.experiment.ExpressionExperimentDetailsValueObject) Date(java.util.Date) Test(org.junit.Test) BaseSpringWebTest(ubic.gemma.web.util.BaseSpringWebTest)

Example 25 with ArrayDesignValueObject

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());
}
Also used : ExpressionExperimentValueObject(ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject) ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject) ExpressionExperimentDetailsValueObject(ubic.gemma.model.expression.experiment.ExpressionExperimentDetailsValueObject) Test(org.junit.Test) BaseSpringWebTest(ubic.gemma.web.util.BaseSpringWebTest)

Aggregations

ArrayDesignValueObject (ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)26 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)7 BioMaterialValueObject (ubic.gemma.model.expression.biomaterial.BioMaterialValueObject)4 BioAssayValueObject (ubic.gemma.model.expression.bioAssay.BioAssayValueObject)3 StopWatch (org.apache.commons.lang3.time.StopWatch)2 Test (org.junit.Test)2 ExpressionExperimentDetailsValueObject (ubic.gemma.model.expression.experiment.ExpressionExperimentDetailsValueObject)2 ExpressionExperimentValueObject (ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject)2 FactorValue (ubic.gemma.model.expression.experiment.FactorValue)2 FactorValueValueObject (ubic.gemma.model.expression.experiment.FactorValueValueObject)2 BaseSpringWebTest (ubic.gemma.web.util.BaseSpringWebTest)2 DoubleArrayList (cern.colt.list.DoubleArrayList)1 MapperException (com.sdicons.json.mapper.MapperException)1 Date (java.util.Date)1 JspException (javax.servlet.jsp.JspException)1 Secured (org.springframework.security.access.annotation.Secured)1 ObjectError (org.springframework.validation.ObjectError)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1 RedirectView (org.springframework.web.servlet.view.RedirectView)1 SearchResult (ubic.gemma.core.search.SearchResult)1