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;
}
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;
}
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.]";
}
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;
}
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;
}
Aggregations