Search in sources :

Example 1 with ReleaseInfoStats

use of org.nextprot.api.core.domain.release.ReleaseInfoStats in project nextprot-api by calipho-sib.

the class ReleaseInfoServiceImpl method findReleaseStats.

@Override
@Cacheable("release-stats")
public ReleaseInfoStats findReleaseStats() {
    ReleaseInfoStats rs = new ReleaseInfoStats();
    List<ReleaseStatsTag> stats = releaseStatsDao.findTagStatistics();
    for (ReleaseStatsTag statsTag : stats) {
        if ("PROTEIN_LEVEL_MASTER".equals(statsTag.getTag())) {
            statsTag.setCount(masterIdentifierService.findEntryAccessionsByProteinExistence(ProteinExistence.PROTEIN_LEVEL).size());
        } else if ("TRANSCRIPT_LEVEL_MASTER".equals(statsTag.getTag())) {
            statsTag.setCount(masterIdentifierService.findEntryAccessionsByProteinExistence(ProteinExistence.TRANSCRIPT_LEVEL).size());
        } else if ("HOMOLOGY_MASTER".equals(statsTag.getTag())) {
            statsTag.setCount(masterIdentifierService.findEntryAccessionsByProteinExistence(ProteinExistence.HOMOLOGY).size());
        } else if ("PREDICTED_MASTER".equals(statsTag.getTag())) {
            statsTag.setCount(masterIdentifierService.findEntryAccessionsByProteinExistence(ProteinExistence.PREDICTED).size());
        } else if ("UNCERTAIN_MASTER".equals(statsTag.getTag())) {
            statsTag.setCount(masterIdentifierService.findEntryAccessionsByProteinExistence(ProteinExistence.UNCERTAIN).size());
        }
    }
    rs.setTagStatistics(stats);
    return rs;
}
Also used : ReleaseInfoStats(org.nextprot.api.core.domain.release.ReleaseInfoStats) ReleaseStatsTag(org.nextprot.api.core.domain.release.ReleaseStatsTag) Cacheable(org.springframework.cache.annotation.Cacheable)

Aggregations

ReleaseInfoStats (org.nextprot.api.core.domain.release.ReleaseInfoStats)1 ReleaseStatsTag (org.nextprot.api.core.domain.release.ReleaseStatsTag)1 Cacheable (org.springframework.cache.annotation.Cacheable)1