Search in sources :

Example 1 with DbXrefService

use of org.nextprot.api.core.service.DbXrefService in project nextprot-api by calipho-sib.

the class DbXrefAnalyserTask method analyseNextprotEntriesDbXrefs.

private void analyseNextprotEntriesDbXrefs() throws IOException {
    LOGGER.info("**** Analysing dbxrefs from entry accession...");
    ConsoleProgressBar pb;
    try (DbXrefUrlVisitor visitor = new DbXrefUrlVisitor(outputDirectory + "/allentries-xrefs-url.tsv", outputDirectory + "/allentries-xrefs-url.log")) {
        DbXrefService xrefService = getBean(DbXrefService.class);
        Set<String> allEntryAcs = getNextprotEntries();
        pb = ConsoleProgressBar.determinated("analysing dbxrefs (from neXtProt entries)", allEntryAcs.size());
        pb.start();
        for (String entryAc : allEntryAcs) {
            try {
                visitor.visit(entryAc, xrefService.findDbXrefsByMaster(entryAc));
                visitor.flush();
                pb.incrementValue();
            } catch (EntryNotFoundException e) {
                LOGGER.error(e.getMessage() + ": skipping entry " + entryAc);
            }
        }
        visitor.flush();
        visitor.close();
    }
    pb.stop();
}
Also used : DbXrefService(org.nextprot.api.core.service.DbXrefService) EntryNotFoundException(org.nextprot.api.commons.exception.EntryNotFoundException) ConsoleProgressBar(org.nextprot.api.commons.app.ConsoleProgressBar)

Aggregations

ConsoleProgressBar (org.nextprot.api.commons.app.ConsoleProgressBar)1 EntryNotFoundException (org.nextprot.api.commons.exception.EntryNotFoundException)1 DbXrefService (org.nextprot.api.core.service.DbXrefService)1