Search in sources :

Example 1 with AssociationDocument

use of uk.ac.ebi.spot.goci.model.AssociationDocument 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)));
        });
    });
}
Also used : EfoDocument(uk.ac.ebi.spot.goci.model.EfoDocument) StudyDocument(uk.ac.ebi.spot.goci.model.StudyDocument) EfoTrait(uk.ac.ebi.spot.goci.model.EfoTrait) HashSet(java.util.HashSet) AssociationDocument(uk.ac.ebi.spot.goci.model.AssociationDocument)

Aggregations

HashSet (java.util.HashSet)1 AssociationDocument (uk.ac.ebi.spot.goci.model.AssociationDocument)1 EfoDocument (uk.ac.ebi.spot.goci.model.EfoDocument)1 EfoTrait (uk.ac.ebi.spot.goci.model.EfoTrait)1 StudyDocument (uk.ac.ebi.spot.goci.model.StudyDocument)1