use of uk.ac.ebi.spot.goci.model.Association in project goci by EBISPOT.
the class SolrIndexer method mapAssociations.
Integer mapAssociations() {
Sort sort = new Sort(new Sort.Order("id"));
Pageable pager = new PageRequest(0, pageSize, sort);
Page<Association> associationPage = associationService.findPublishedAssociations(pager);
associationMapper.map(associationPage.getContent());
while (associationPage.hasNext()) {
if (maxPages != -1 && associationPage.getNumber() >= maxPages - 1) {
break;
}
pager = pager.next();
associationPage = associationService.findPublishedAssociations(pager);
associationMapper.map(associationPage.getContent());
if (sysOutLogging) {
System.out.print(".");
}
}
return (int) associationPage.getTotalElements();
}
use of uk.ac.ebi.spot.goci.model.Association in project goci by EBISPOT.
the class DataDeletionService method deleteStudy.
private void deleteStudy(Study study) {
System.out.println("Removing study \t" + study.getAuthor() + "\t (ID:" + study.getId() + ") with \t" + study.getAssociations().size() + "\t association and \t" + study.getAncestries().size() + "\t ancestries");
getLog().debug("Removing study \t" + study.getAuthor() + "\t (ID:" + study.getId() + ") with \t" + study.getAssociations().size() + "\t association and \t" + study.getAncestries().size() + "\t ancestries");
Collection<Association> associations = study.getAssociations();
associations.forEach(this::deleteAssociation);
Collection<Ancestry> ancestries = ancestryRepository.findByStudyId(study.getId());
for (Ancestry ancestry : ancestries) {
ancestryRepository.delete(ancestry);
}
// WeeklyTracking, CuratorTracking and Note. Please use this method!
// Shared with === DataDeletionService ===
studyService.deleteRelatedInfoByStudy(study);
// Delete study
studyService.deleteByStudyId(study.getId());
}
use of uk.ac.ebi.spot.goci.model.Association in project goci by EBISPOT.
the class MapCatalogService method mapCatalogContentsByAssociations.
// This method should be refactor with mapCatalogContentsNight
public void mapCatalogContentsByAssociations(String performer, Collection<Association> associations) throws EnsemblMappingException {
Collection<Association> associationsToMap = associationService.findAssociationAssociationData(associations);
getLog().info("Mapping all associations in database, total number: " + associationsToMap.size());
try {
mappingService.validateAndMapAllAssociations(associationsToMap, performer);
} catch (EnsemblMappingException e) {
throw new EnsemblMappingException("Attempt to map all associations failed", e);
}
}
use of uk.ac.ebi.spot.goci.model.Association in project goci by EBISPOT.
the class MapCatalogService method mapCatalogContents.
/**
* Get all associations in database and map
*
* @param performer name of curator/job carrying out the mapping
*/
public void mapCatalogContents(String performer) throws EnsemblMappingException {
// Get all old association reports so we can compare with new ones, do this before we remap
Collection<AssociationReport> oldAssociationReports = associationReportRepository.findAll();
// Get all associations via service
Collection<Association> associations = associationService.findAllAssociations();
getLog().info("Mapping all associations in database, total number: " + associations.size());
try {
mappingService.validateAndMapAllAssociations(associations, performer);
} catch (EnsemblMappingException e) {
throw new EnsemblMappingException("Attempt to map all associations failed", e);
}
mappingErrorComparisonService.compareOldVersusNewErrors(oldAssociationReports, false, 0, 0);
}
use of uk.ac.ebi.spot.goci.model.Association in project goci by EBISPOT.
the class MapCatalogService method mapCatalogContentsNight.
public void mapCatalogContentsNight(String performer) throws EnsemblMappingException {
Collection<Association> associations = associationService.findAssociationToMap();
getLog().info("Mapping all associations in database, total number: " + associations.size());
try {
mappingService.validateAndMapAllAssociations(associations, performer);
} catch (EnsemblMappingException e) {
throw new EnsemblMappingException("Attempt to map all associations failed", e);
}
}
Aggregations