Search in sources :

Example 16 with ArrayDesignValueObject

use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.

the class ArrayDesignDaoImpl method processADValueObjectQueryResults.

/**
 * Process query results for LoadAllValueObjects or LoadValueObjects
 */
private Collection<ArrayDesignValueObject> processADValueObjectQueryResults(Map<Long, Integer> eeCounts, final Query query) {
    query.setCacheable(true);
    // noinspection unchecked
    List<Object[]> list = query.list();
    Collection<ArrayDesignValueObject> vos = new ArrayList<>(list.size());
    for (Object[] row : list) {
        ArrayDesignValueObject vo = new ArrayDesignValueObject(row);
        Long id = (Long) row[0];
        if (eeCounts == null || !eeCounts.containsKey(id)) {
            vo.setExpressionExperimentCount(0);
        } else {
            vo.setExpressionExperimentCount(eeCounts.get(id));
        }
        vos.add(vo);
    }
    return vos;
}
Also used : ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject) ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

Example 17 with ArrayDesignValueObject

use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.

the class CommonQueries method getArrayDesignsUsedVOs.

public static Collection<ArrayDesignValueObject> getArrayDesignsUsedVOs(Long eeId, Session session) {
    List<?> list = CommonQueries.createGetADsUsedQueryObject(eeId, session).list();
    Collection<ArrayDesignValueObject> vos = new LinkedList<>();
    for (ArrayDesign ad : (Collection<ArrayDesign>) list) {
        vos.add(new ArrayDesignValueObject(ad));
    }
    return vos;
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

Example 18 with ArrayDesignValueObject

use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.

the class ArrayDesignControllerImpl method getSummaryForArrayDesign.

@Override
public String getSummaryForArrayDesign(Long id) {
    Collection<Long> ids = new ArrayList<>();
    ids.add(id);
    Collection<ArrayDesignValueObject> adVos = arrayDesignService.loadValueObjectsByIds(ids);
    arrayDesignReportService.fillInValueObjects(adVos);
    if (!adVos.isEmpty() && adVos.toArray()[0] != null) {
        ArrayDesignValueObject advo = (ArrayDesignValueObject) adVos.toArray()[0];
        StringBuilder buf = new StringBuilder();
        buf.append("<div style=\"float:left\" >");
        if (advo.getNumProbeAlignments() != null) {
            buf.append(ArrayDesignHtmlUtil.getSummaryHtml(advo));
        } else {
            buf.append("[Not avail.]");
        }
        buf.append("</div>");
        return buf.toString();
    }
    return "[Not avail.]";
}
Also used : ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

Example 19 with ArrayDesignValueObject

use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.

the class ArrayDesignControllerImpl method setSummaryInfo.

/**
 * Sets the summary info on the given value object.
 */
private ArrayDesignValueObjectExt setSummaryInfo(ArrayDesignValueObjectExt result, Long id) {
    ArrayDesignValueObject summary = arrayDesignReportService.getSummaryObject(id);
    if (summary != null) {
        result.setNumProbeAlignments(summary.getNumProbeAlignments());
        result.setNumProbesToGenes(summary.getNumProbesToGenes());
        result.setNumProbeSequences(summary.getNumProbeSequences());
    }
    return result;
}
Also used : ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

Example 20 with ArrayDesignValueObject

use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.

the class ArrayDesignControllerImpl method getDetails.

@Override
public ArrayDesignValueObjectExt getDetails(Long id) {
    ArrayDesign arrayDesign = this.getADSafely(id);
    log.info("Loading details of " + arrayDesign);
    ArrayDesignValueObject vo = arrayDesignService.loadValueObject(arrayDesignService.load(id));
    if (vo == null) {
        throw new IllegalArgumentException("You do not have appropriate rights to see this platform. This is likely due " + "to the platform being marked as unusable.");
    }
    arrayDesignReportService.fillInValueObjects(Lists.newArrayList(vo));
    arrayDesignReportService.fillInSubsumptionInfo(Lists.newArrayList(vo));
    ArrayDesignValueObjectExt result = new ArrayDesignValueObjectExt(vo);
    result = this.setExtRefsAndCounts(result, arrayDesign);
    result = this.setAlternateNames(result, arrayDesign);
    result = this.setExtRefsAndCounts(result, arrayDesign);
    result = this.setSummaryInfo(result, id);
    // SLOW if we follow down to mergees of mergees etc.
    populateMergeStatus(arrayDesign, result);
    log.info("Finished loading details of " + arrayDesign);
    return result;
}
Also used : ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)

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