use of uk.ac.ebi.spot.goci.model.StudyDocument in project goci by EBISPOT.
the class TraitEnrichmentService method doEnrichment.
@Override
public void doEnrichment(DiseaseTraitDocument document) {
long id = Long.valueOf(document.getId().split(":")[1]);
studyService.findByDiseaseTraitId(id).forEach(study -> {
document.embed(new StudyDocument(study));
Set<EfoTrait> efoTraits = new HashSet<>();
traitService.findMappedTraitByStudyId(study.getId()).forEach(efoTraits::add);
efoTraits.forEach(trait -> {
document.embed(new EfoDocument(trait));
associationService.findPublishedAssociationsByEfoTraitId(trait.getId()).forEach(association -> document.embed(new AssociationDocument(association)));
});
});
}
use of uk.ac.ebi.spot.goci.model.StudyDocument in project goci by EBISPOT.
the class AssociationEnrichmentService method doEnrichment.
@Override
public void doEnrichment(AssociationDocument document) {
long id = Long.valueOf(document.getId().split(":")[1]);
studyService.findByAssociationId(id).forEach(study -> {
document.addStudyId(String.valueOf(study.getId()));
document.embed(new StudyDocument(study));
});
traitService.findReportedTraitByAssociationId(id).forEach(trait -> document.embed(new DiseaseTraitDocument(trait)));
traitService.findMappedTraitByAssociationId(id).forEach(trait -> document.embed(new EfoDocument(trait)));
}
Aggregations