use of ubic.gemma.model.genome.gene.phenotype.valueObject.BibliographicPhenotypesValueObject in project Gemma by PavlidisLab.
the class BibliographicReferenceControllerImpl method browse.
@Override
public JsonReaderResponse<BibliographicReferenceValueObject> browse(ListBatchCommand batch) {
Integer count = this.bibliographicReferenceService.countAll();
List<BibliographicReference> records = this.getBatch(batch);
Map<BibliographicReference, Collection<ExpressionExperiment>> relatedExperiments = this.bibliographicReferenceService.getRelatedExperiments(records);
List<BibliographicReferenceValueObject> valueObjects = new ArrayList<>();
for (BibliographicReference ref : records) {
ref = this.bibliographicReferenceService.thaw(ref);
BibliographicReferenceValueObject vo = new BibliographicReferenceValueObject(ref);
if (relatedExperiments.containsKey(ref)) {
vo.setExperiments(expressionExperimentService.loadValueObjects(relatedExperiments.get(ref)));
}
valueObjects.add(vo);
// adding phenotype information to the Bibliographic Reference
Collection<PhenotypeAssociation> phenotypeAssociations = this.phenotypeAssociationService.findPhenotypesForBibliographicReference(vo.getPubAccession());
Collection<BibliographicPhenotypesValueObject> bibliographicPhenotypesValueObjects = BibliographicPhenotypesValueObject.phenotypeAssociations2BibliographicPhenotypesValueObjects(phenotypeAssociations);
vo.setBibliographicPhenotypes(bibliographicPhenotypesValueObjects);
}
return new JsonReaderResponse<>(valueObjects, count);
}
Aggregations